From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5899 invoked by alias); 1 Sep 2009 22:11:35 -0000 Received: (qmail 5889 invoked by uid 22791); 1 Sep 2009 22:11:34 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Sep 2009 22:11:28 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 8EE6B108C6; Tue, 1 Sep 2009 22:11:24 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 655901055A; Tue, 1 Sep 2009 22:11:24 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MibZS-0006i3-Qd; Tue, 01 Sep 2009 18:11:22 -0400 Date: Tue, 01 Sep 2009 22:11:00 -0000 From: Daniel Jacobowitz To: Keith Seitz Cc: Michael Eager , gdb-patches@sourceware.org Subject: Re: [RFA] dwarf2_physname Message-ID: <20090901221122.GA24658@caradoc.them.org> Mail-Followup-To: Keith Seitz , Michael Eager , gdb-patches@sourceware.org References: <4A9C358E.2050904@redhat.com> <4A9C54F6.1000909@eagercon.com> <4A9C5A66.7060609@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A9C5A66.7060609@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00034.txt.bz2 On Mon, Aug 31, 2009 at 04:19:02PM -0700, Keith Seitz wrote: > On 08/31/2009 03:55 PM, Michael Eager wrote: > > >Does this mean that (eventually) the DW_AT_MIPS_linkage_name attribute > >will not be needed by GDB? > > That is exactly what it is intended to do. MIPS_linkage_name is not > needed in any case I've been able to invent on my > archer-keiths-expr-cumulative branch, and that branch has MUCH > tougher C++ tests than FSF gdb does. I assume this patch is a distant descendant of the one I sent you a while back. Is its goal to create a useful name for each symbol, or to match the one produced by some other source - probably the demangler? What sort of template cases have you looked at? As you know, I spent several some time trying to do without DW_AT_MIPS_linkage_name. My main goals were cleanliness and compatibility with a non-GCC compiler (ARM RealView). I came across a lot of cases where the output from neither GCC nor any other compiler I could get my hands on made sense without a linkage name in the debug info - and I couldn't find a way to get sensible representation in DWARF, either. Here's one case I remember having trouble with. template int f() { return S[0]; } char Foo[3]; char Bar[3]; int main() { return f() + f(); } 0000000000000000 W int f<&Bar>() 0000000000000000 W int f<&Foo>() <1><31>: Abbrev Number: 2 (DW_TAG_subprogram) <32> DW_AT_external : 1 <33> DW_AT_name : (indirect string, offset: 0x47): f<((char*)(& Foo))> <37> DW_AT_decl_file : 1 <38> DW_AT_decl_line : 1 <39> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x1f): _Z1fIXadL_Z3FooEEEiv <3d> DW_AT_type : <0x55> <41> DW_AT_low_pc : 0x0 <49> DW_AT_high_pc : 0x10 <51> DW_AT_frame_base : 0x0 (location list) You have to represent the name "Foo" in the debug info - the address isn't enough, there could be other symbols apparently at the same address. The name this older GCC emits is not useful. Most other compilers just punted. While hopefully Dodji has made HEAD GCC do something sensible now, we have to handle all those field compilers :-) -- Daniel Jacobowitz CodeSourcery