From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3082 invoked by alias); 1 Sep 2009 23:26:59 -0000 Received: (qmail 3069 invoked by uid 22791); 1 Sep 2009 23:26:58 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12,J_CHICKENPOX_84,SPF_HELO_PASS,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Sep 2009 23:26:52 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n81NQnBZ023919; Tue, 1 Sep 2009 19:26:49 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n81NQkEu009742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Sep 2009 19:26:48 -0400 Message-ID: <4A9DADB6.2090508@redhat.com> Date: Tue, 01 Sep 2009 23:26:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 MIME-Version: 1.0 To: drow@false.org CC: gdb-patches@sourceware.org Subject: Re: [RFA] dwarf2_physname References: <4A9C358E.2050904@redhat.com> <4A9C54F6.1000909@eagercon.com> <4A9C5A66.7060609@redhat.com> <20090901221122.GA24658@caradoc.them.org> In-Reply-To: <20090901221122.GA24658@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00041.txt.bz2 On 09/01/2009 03:11 PM, Daniel Jacobowitz wrote: > 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? Yes, this is based on the patches you sent me a long, long time ago. The goal is to generate a physname that is unique; it may match the output of the demangler, but that is not a requirement. It is supposed to construct valid, fully-qualified names, i.e, you won't see "std::string" as a physname. It's really "std::basic_string". The template cases I've looked at are checked-in on the archer-keiths-realcpp-test branch. I've just committed the latest and greatest version of realcpp.{exp,cc} here: http://tinyurl.com/lkaadh (git.sourceware.org -- sorry for the tinyurl thing, git URL names are loooooooong). Unfortunately, I cannot speak to other compilers, only gcc. > 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(); > } What do you want to do with this? Print it and break/list it? On my archer-keiths-expr-cumulative branch (which does NOT use linkage_name): (gdb) info func f All functions matching regular expression "f": File a.cc: int f<(char*)(&Bar)>(); int f<(char*)(&Foo)>(); Non-debugging symbols: 0x08048420 frame_dummy 0x08048490 __libc_csu_fini 0x0804852c _fini (gdb) p f<(char*)(&Foo)> $1 = {int (void)} 0x8048465 ()> (gdb) list 'f<(char*)(&Foo)>' 1 template int f() 2 { 3 return S[0]; 4 } 5 6 char Foo[3]; 7 char Bar[3]; 8 9 int main() 10 { (gdb) b 'f<(char*)(&Foo)>' Breakpoint 1 at 0x8048468: file a.cc, line 3. (gdb) r Starting program: /home/keiths/tmp/a Breakpoint 1, f<(char*)(&Foo)> () at a.cc:3 3 return S[0]; (gdb) bt #0 f<(char*)(&Foo)> () at a.cc:3 #1 0x08048453 in main () at a.cc:11 (gdb) I know that "f<(char*)(&Foo)>" is ugly, but that is the name that gcc gives us (DW_AT_name for this DIE), so we have to use it. [I am assuming we could get this cleaned up/"fixed" in gcc.] On FSF gdb HEAD, you can do something similar with "int f<&Foo>" (yes, you *have* to add the return type) instead of "f<(char*)(&Foo)>"... Keith