From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20544 invoked by alias); 4 Feb 2010 18:14:20 -0000 Received: (qmail 20536 invoked by uid 22791); 4 Feb 2010 18:14:19 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Feb 2010 18:14:15 +0000 Received: (qmail 17127 invoked from network); 4 Feb 2010 18:14:14 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Feb 2010 18:14:14 -0000 Date: Thu, 04 Feb 2010 18:14:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: Keith Seitz , gdb-patches@sourceware.org Subject: Re: [RFA 2/4] dwarf2_physname Message-ID: <20100204181358.GA27544@caradoc.them.org> Mail-Followup-To: Tom Tromey , Keith Seitz , gdb-patches@sourceware.org References: <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> <4B68B400.3030407@redhat.com> <20100203024553.GA22235@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00127.txt.bz2 On Thu, Feb 04, 2010 at 10:48:13AM -0700, Tom Tromey wrote: > >> + case DW_TAG_variable: > >> + { > >> + struct attribute *attr; > >> + attr = dwarf2_attr (die, DW_AT_specification, cu); > >> + if (attr) > >> + return 1; > > Based on the above I am guessing it is the early return here? That's part of it. Also, I don't think the check for DW_AT_external tests what we want (which is what I'm trying to pin down - what is the desired property?). Check the debug info for this: namespace X { int xx; static int yy; } xx is DW_AT_external, yy isn't. > 1. If the variable is declared in the namespace scope, but defined > outside, then a second defining DIE is emitted that refers to the > declaration DIE using DW_AT_specification. In this case the declaration > DIE's namespace is used. > > ... The code above seems to cheat a tiny bit because it unconditionally > returns 1 in this case, whereas it should perhaps recurse. Recursing's a good idea. I hadn't thought of that. > I'm still not understanding what problem you see, but I would like to. I really, really want a specification for this function that describes what it's trying to accomplish. I don't understand what it's for, so it's hard to translate my red flags into suggestions. -- Daniel Jacobowitz CodeSourcery