public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Differences between Gold-produced gdb-index and GDB-produced gdb-index
@ 2011-10-05 19:07 Sterling Augustine
  2011-10-05 20:29 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Sterling Augustine @ 2011-10-05 19:07 UTC (permalink / raw)
  To: gdb

[Resend now that tromey is back.]

Hi All,

gdb_index handles enumerator names inconsistently. It includes the
enum's name as part of the enumerator name, but only when it is
declared inside a namespace. When outside of a namespace, it leaves
the enumerator name out:

enum A { A_A };
enum A a = A_A;

namespace foo
{
enum B { B_B };
enum B b = B_B;
};

int main() {return 0;}

For this testcase, gdb index will include (among others):

A_A
foo::B::B_B

That seems wrong to me. Which is right? FWIW, Gold includes the enum
name in both cases.

Sterling

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Differences between Gold-produced gdb-index and GDB-produced gdb-index
  2011-10-05 19:07 Differences between Gold-produced gdb-index and GDB-produced gdb-index Sterling Augustine
@ 2011-10-05 20:29 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2011-10-05 20:29 UTC (permalink / raw)
  To: Sterling Augustine; +Cc: gdb

>>>>> "Sterling" == Sterling Augustine <saugustine@google.com> writes:

Sterling> [Resend now that tromey is back.]

I just sent a reply a few minutes ago :-)
Maybe I was confused then though.

Sterling> A_A
Sterling> foo::B::B_B

Sterling> That seems wrong to me. Which is right? FWIW, Gold includes the enum
Sterling> name in both cases.

I think the right answer is A_A and foo::B_B.
I am not completely positive.

I think what you'd have to do is dig into gdb to see what is the right
answer for expression parsing, symbol lookup, etc; then make sure that
gdb actually uses this in its symbol tables.  The index has to reflect
whatever gdb decides; but this does not necessarily imply that gdb is
presently correct.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-05 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05 19:07 Differences between Gold-produced gdb-index and GDB-produced gdb-index Sterling Augustine
2011-10-05 20:29 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).