From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 527 invoked by alias); 8 Oct 2011 00:46:29 -0000 Received: (qmail 518 invoked by uid 22791); 8 Oct 2011 00:46:28 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 08 Oct 2011 00:46:12 +0000 Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id p980k9UY030760 for ; Fri, 7 Oct 2011 17:46:10 -0700 Received: from vws14 (vws14.prod.google.com [10.241.21.142]) by wpaz29.hot.corp.google.com with ESMTP id p980jfa2022984 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 7 Oct 2011 17:46:08 -0700 Received: by vws14 with SMTP id 14so6547077vws.3 for ; Fri, 07 Oct 2011 17:46:08 -0700 (PDT) Received: by 10.101.148.40 with SMTP id a40mr2015707ano.2.1318034768364; Fri, 07 Oct 2011 17:46:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.148.40 with SMTP id a40mr2015700ano.2.1318034768197; Fri, 07 Oct 2011 17:46:08 -0700 (PDT) Received: by 10.100.225.14 with HTTP; Fri, 7 Oct 2011 17:46:08 -0700 (PDT) In-Reply-To: <4E8F8E82.8060803@redhat.com> References: <4E8F8E82.8060803@redhat.com> Date: Sat, 08 Oct 2011 00:46:00 -0000 Message-ID: Subject: Re: Make DW_TAG_enumerator's consistent, regardless of containing scope From: Sterling Augustine To: Keith Seitz Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true 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/msg00215.txt.bz2 On Fri, Oct 7, 2011 at 4:42 PM, Keith Seitz wrote: > 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'll write one this weekend. > I've tried to reproduce this, but I cannot seem to replicate using your > instructions: .... > $ g++ -g enum0*.cc -o enum; popd Try it without the wildcard. The shell can glob enum0.cc before enum0_main.cc, but the test-case needs enum0_main.cc first on gcc's command line. The order matters because when the namespace foo gets looked up in the partial symbol table, GDB builds the full-symbol table, and the full symbol table has it right. If gdb finds enum0.cc's copy of the namespace foo die first, then when it converts that CU's psymtab to a full symtab, the enum's correct name will be created and you won't see the problem. However, if gdb find's enum0_main.cc's namespace foo die first, then the conversion to the full psymtab won't create one for the enum. This hints to me--but I'm not sure--that some kind of special handling for namespace dies would be appropriate, because they can appear in multiple CU's. But that is beyond the present issue. This Sterling