From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24046 invoked by alias); 7 Oct 2011 23:43:29 -0000 Received: (qmail 24030 invoked by uid 22791); 7 Oct 2011 23:43:27 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_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; Fri, 07 Oct 2011 23:43:04 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p97Nh1nl012726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 Oct 2011 19:43:01 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p97Ngwiu005518 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 7 Oct 2011 19:43:00 -0400 Message-ID: <4E8F8E82.8060803@redhat.com> Date: Fri, 07 Oct 2011 23:43:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: Sterling Augustine CC: gdb-patches@sourceware.org Subject: Re: Make DW_TAG_enumerator's consistent, regardless of containing scope References: In-Reply-To: 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: 2011-10/txt/msg00214.txt.bz2 On 10/07/2011 02:26 PM, Sterling Augustine wrote: > saugustine@sterling$ g++ -g enum0_main.cc enum0.cc -o enum-namespace > saugustine@sterling$ gdb ./enum-namespace > GNU gdb (GDB) 7.3.50.20111007-cvs > ... > (gdb) p foo::B_B > No symbol "B_B" in namespace "foo". > (gdb) p foo::B::B_B > `foo::B' is not defined as an aggregate type. First things first: this is going to need a test case. I've tried to reproduce this, but I cannot seem to replicate using your instructions: $ cat > enum0_main.cc << EOF > namespace foo { } > int main () { return 0; } > EOF $ cat > enum0.cc << EOF > namespace foo { > enum B { B_B }; > enum B b = B_B; > }; > EOF $ g++ -g enum0*.cc -o enum; popd $ ./gdb -v GNU gdb (GDB) 7.3.50.20111005-cvs Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/keiths/tmp/enum...done. (gdb) p foo::B_B $1 = foo::B_B Although this appears to work, your patch looks correct to me. If I inspect the partial die names and the physnames, they do differ (foo::B::B_B vs foo::B_B), and clearly foo::B::B_B is incorrect, since enum B_B is of the unscoped variety. I would also not expect to see any child dies for DW_TAG_enumerator, so I agree that testing parent_die->tag == DW_TAG_enumerator doesn't make sense. IMO, I would recommend that a maintainer accept this patch (with a test case). Aside: If support is added for scoped enumerations, this will need modifying -- the original behavior is correct in that case (but still not for unscoped enums). dwarf2_compute_name will also need fixing. :-)] Keith