This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch by Michael Matz] Re: archer gdb and gcc 4.1 global namespaceDIE



[...] which brings me back to my other option (that's the one I started and tested with), hacking determine_prefix, like below. That fixes the problem. Really :-)


Nice.. I am a fan of solution 2 as well :)
The patch works for me and introduces no regressions, at lease on x86_64 and gcc43.


One question though. Is there a reason not to use strcmp(prefix,"::")==0 to compare the string ?



Ciao, Michael. Index: gdb-6.8.50.20090302/gdb/dwarf2read.c =================================================================== --- gdb-6.8.50.20090302.orig/gdb/dwarf2read.c 2009-05-13 15:53:22.000000000 +0200 +++ gdb-6.8.50.20090302/gdb/dwarf2read.c 2009-05-13 23:48:52.000000000 +0200 @@ -8885,9 +8894,18 @@ determine_prefix (struct die_info *die, switch (parent->tag) { case DW_TAG_namespace: - parent_type = read_type_die (parent, cu); - /* We give a name to even anonymous namespaces. */ - return TYPE_TAG_NAME (parent_type); + { + char *prefix; + parent_type = read_type_die (parent, cu); + /* We give a name to even anonymous namespaces. */ + prefix = TYPE_TAG_NAME (parent_type); + /* Special hack for bogus global namespace that is emitted as an + explicit namespace with the name '::' in g++ 4.1, for + some decls. */ + if (prefix[0] == ':' && prefix[1] == ':' && prefix[2] == 0) + return ""; + return prefix; + } case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]