From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50065 invoked by alias); 20 Oct 2015 22:25:19 -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 50055 invoked by uid 89); 20 Oct 2015 22:25:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 20 Oct 2015 22:25:17 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EB79C368E3; Tue, 20 Oct 2015 22:25:15 +0000 (UTC) Received: from bigtime.twiddle.net (ovpn-113-171.phx2.redhat.com [10.3.113.171]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9KMPFwx031266; Tue, 20 Oct 2015 18:25:15 -0400 To: gdb@sourceware.org From: Richard Henderson Subject: Changes required for x86 address spaces Cc: "H.J. Lu" Message-ID: <5626BF4A.2080600@redhat.com> Date: Tue, 20 Oct 2015 22:25:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00083.txt.bz2 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. One of these days, the various operating systems may enable the fsgsbase ISA extension present in Haswell cpus, so making these values visible within the debugger now is a nice side effect. What isn't present in gdb at present is any support for DW_AT_segment, and I'm not familiar enough with the internals to work out how to enable that. r~