Differences between gdb-index as generated by Gold and GDB itself

Sterling Augustine saugustine@google.com
Mon Sep 26 16:50:00 GMT 2011


Hi All,

I have noticed an inconsistency with GDB index and the names of
enumerated values. Consider this test case:

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

namespace foo {
enum B {  B_B };

enum B b = B_B;
};

int main() { return 0; }

Examining the gdb-index--as produced by GDB--shows an inconsistency
between enumerator names inside a namespace vs outside the namespace:

foo::B::B_B
vs
B_B

That is, the enumerator inside the namespace includes the enum name,
but the enumerator outside the namespace doesn't include the enum
name. Is this a bug in GDB?

The index produced by gold does include the enumerator name, and is
therefore inconsistent with GDB--I'm happy to fix one or the other,
but I'm not sure which one is right.

Sterling



More information about the Gdb mailing list