From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33094 invoked by alias); 21 Oct 2015 02:38:28 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 33065 invoked by uid 89); 21 Oct 2015 02:38:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f179.google.com Received: from mail-ob0-f179.google.com (HELO mail-ob0-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 21 Oct 2015 02:38:26 +0000 Received: by obctp1 with SMTP id tp1so3924757obc.2 for ; Tue, 20 Oct 2015 19:38:24 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.158.99 with SMTP id wt3mr2528944obb.18.1445395104228; Tue, 20 Oct 2015 19:38:24 -0700 (PDT) Received: by 10.76.72.3 with HTTP; Tue, 20 Oct 2015 19:38:24 -0700 (PDT) In-Reply-To: <5626BF4A.2080600@redhat.com> References: <5626BF4A.2080600@redhat.com> Date: Wed, 21 Oct 2015 02:38:00 -0000 Message-ID: Subject: Re: Changes required for x86 address spaces From: "H.J. Lu" To: Richard Henderson Cc: GDB Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-10/txt/msg00084.txt.bz2 On Tue, Oct 20, 2015 at 3:25 PM, Richard Henderson wrote: > Hi! > > Here are some notes regarding gdb changes required in order to support > > https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01972.html > > In my opinion, DW_AT_address_class is best when the alternate address space > is truely disjoint, or has a different pointer width. That certainly > matches up with the language in the dwarf4 doc, and existing usage in the > embedded targets. > > Thus I've arranged for these x86 address spaces to use DW_AT_segment, a > dwarf location containing an offset from the flat address space. For the > purposes of the debug info, I map __seg_tls to __seg_fs or __seg_gs. > > The x86-64 abi already has dwarf register numbers allocated for fs_base and > gs_base. Thus the location is simply the trivial DW_OP_regx 58 or 59 > respectively. The i386 abi does not yet have the same register number > pre-allocated; the latest version I see in HJL's github document has dwarf > registers 58-59 within a block of reserved values, so for now I'm using the > same values for both x86-64 and i386. > Table 2.14: DWARF Register Number Mapping in Intel386 psABI: https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI defines Segment Register ES 40 %es Segment Register CS 41 %cs Segment Register SS 42 %ss Segment Register DS 43 %ds Segment Register FS 44 %fs Segment Register GS 45 %gs Why not use them? -- H.J.