From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6386 invoked by alias); 2 Feb 2010 23:23:56 -0000 Received: (qmail 6374 invoked by uid 22791); 2 Feb 2010 23:23:55 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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, 02 Feb 2010 23:23:50 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o12NNnbd025148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Feb 2010 18:23:49 -0500 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o12NNi9l029013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Feb 2010 18:23:48 -0500 Message-ID: <4B68B400.3030407@redhat.com> Date: Tue, 02 Feb 2010 23:23:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-3.fc11 Lightning/1.0pre Thunderbird/3.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [RFA 2/4] dwarf2_physname References: <4B576983.2090808@redhat.com> <20100126211733.GA17877@caradoc.them.org> <4B609019.1090807@redhat.com> <4B61F20B.7070908@redhat.com> <20100128202429.GA29835@caradoc.them.org> <4B622047.7020503@redhat.com> <20100201164837.GF21339@caradoc.them.org> <4B672C38.60007@redhat.com> <20100201193941.GA17445@caradoc.them.org> <4B674D1B.5040209@redhat.com> <20100201221905.GA15584@caradoc.them.org> In-Reply-To: <20100201221905.GA15584@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: 2010-02/txt/msg00048.txt.bz2 On 02/01/2010 02:19 PM, Daniel Jacobowitz wrote: > What're we trying to answer? For instance, is it the distinction > between local variables and global variables? This is interesting > because I believe that function-local classes get the enclosing > function as a prefix, but obviously function-local automatic variables > should not. Yes, it was specifically to deal with class static members. Reminder: namespace { namespace G { int Gx; }; }; gcc will output: DW_TAG_namespace -- DW_TAG_namespace -- DW_AT_name = "G" ---- DW_TAG_variable ---- DW_AT_name = "Gx" DW_TAG_variable -- DW_AT_location -- DW_AT_specification = DW_TAG_variable above This seems to be correct as far as my interpretation of the DWARF3 spec (Dec 20, 2005), Section 4.1 #6 (pg 60). > I'm not sure how DW_TAG_member comes into this either, that doesn't > entirely make sense for non-static class members. Be careful about > this one: GCC sometimes incorrectly uses DW_TAG_variable, when the > DWARF standard says they should be DW_TAG_member. DW_TAG_member does not run through this branch, unless, as you say, gcc incorrectly emits DW_TAG_variable instead of DW_TAG_member. I have only seen gcc output DW_TAG_variable for member data in two situations: 1) static class members (which I think is correct) and 2) const class members where the class is not instantiated. To elaborate on #2: Consider the following class: class A { public: static const int a_constant = 3; }; int main (int argc, char* argv[]) { return A::a_constant; } Gcc will *NOT* output anything about A::a_constant *except* for a DW_TAG_variable describing it (DW_AT_name = "a_constant"). No DW_AT_specification (as I think there should be). In fact, DW_TAG_class_type for A is completely omitted. The only clue that gdb gets (either dwarf2_physname or CVS HEAD) is in DW_AT_MIPS_linkage_name. This is obviously a gcc bug. Do you have another example where gcc does this that you'd like me to look at? Or maybe I'm simply not answering your question? [A kind of forest/tree thing...] Keith