Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sterling Augustine <saugustine@google.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Make DW_TAG_enumerator's consistent, regardless of containing scope
Date: Sat, 08 Oct 2011 00:46:00 -0000	[thread overview]
Message-ID: <CAEG7qUxCtV++R7Jdf-ZjVnnmeT83UwMb_MiWk_b4rbZuAoR9eg@mail.gmail.com> (raw)
In-Reply-To: <4E8F8E82.8060803@redhat.com>

On Fri, Oct 7, 2011 at 4:42 PM, Keith Seitz <keiths@redhat.com> 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


  reply	other threads:[~2011-10-08  0:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-07 21:27 Sterling Augustine
2011-10-07 23:43 ` Keith Seitz
2011-10-08  0:46   ` Sterling Augustine [this message]
2011-10-10 22:21 ` Sterling Augustine
2011-10-11 17:07   ` Tom Tromey
2011-10-11 18:27     ` Sterling Augustine
2011-10-11 19:04       ` Tom Tromey
2011-10-12  9:21       ` [obv] Fix gdb.cp/namespace-enum.exp compilation [Re: Make DW_TAG_enumerator's consistent, regardless of containing scope] Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEG7qUxCtV++R7Jdf-ZjVnnmeT83UwMb_MiWk_b4rbZuAoR9eg@mail.gmail.com \
    --to=saugustine@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox