From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7327 invoked by alias); 1 Sep 2009 23:37:42 -0000 Received: (qmail 7311 invoked by uid 22791); 1 Sep 2009 23:37:41 -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 23:37:37 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id F2A04108C6; Tue, 1 Sep 2009 23:37:34 +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 AB6B01055A; Tue, 1 Sep 2009 23:37:34 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1Micur-0000S6-9G; Tue, 01 Sep 2009 19:37:33 -0400 Date: Tue, 01 Sep 2009 23:37:00 -0000 From: Daniel Jacobowitz To: Michael Eager Cc: Keith Seitz , gdb-patches@sourceware.org Subject: Re: [RFA] dwarf2_physname Message-ID: <20090901233733.GA32355@caradoc.them.org> Mail-Followup-To: Michael Eager , Keith Seitz , gdb-patches@sourceware.org References: <4A9C358E.2050904@redhat.com> <4A9C54F6.1000909@eagercon.com> <4A9C5A66.7060609@redhat.com> <20090901221122.GA24658@caradoc.them.org> <4A9DABA4.3010402@eagercon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A9DABA4.3010402@eagercon.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/msg00042.txt.bz2 On Tue, Sep 01, 2009 at 04:17:56PM -0700, Michael Eager wrote: > I think that this is a problem with how the template instantiation is > described. For your example DWARF: > I think that there should be something like > DW_TAG_template_value_parameter > DW_AT_name : Foo > DW_AT_type : > as a child of of f. I believe DW_AT_name would be S here and not Foo - the name by which the argument is known inside the instantiation. It's representing Foo that's a problem; it has to go in the DW_AT_const_value attribute. Here's a trickier example: template int f() { return S[0]; } template struct S {}; template int g(S*) { return 0; } char Foo[3]; char Bar[3]; int main() { return f() + f() + g<5, Foo>(0); } 0000000000000000 W _Z1gILi5EXadL_Z3FooEEEiP1SIXplplT_Li1EszT0_EE 0000000000000000 W int g<5, &Foo>(S<((5)+(1))+(sizeof (&Foo))>*) A patch that can't handle this may still be an improvement - but I'd like to know how we're approaching this problem, and whether (A) the lack of compilers generating adequate data, and (B) to the best of my knowledge, the lack of DWARF constructs for such expressions, is going to interfere with debugging of heavily templated programs. -- Daniel Jacobowitz CodeSourcery