This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


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

Re: So what is wrong with v3 C++



Daniel Berlin <dan@cgsoftware.com> writes:
> It's actually a bit worse than just needing to rewrite the dwarf2 reader.
> 
> You actually can't fix the stabs reader without gcc's help and a hack.
> For the stabs reader, you need to hack gcc to output fully qualified names 
> for us.
> This is because if you look at the stabs section, you'll see we output 
> types by the normal name, instead of mangled name (types have no mangled 
> name, so it would be tricky to output them :P).
> So we end up with numpunct<char> or, in this case "A".
> 
> For DWARF2, we now have namespace support, and i'll see if i can get it 
> into 3.0.1.  So instead of just seeing:
> 
> DW_TAG_structure_type:
> 	DW_AT_name: A
> we now see
> DW_TAG_namespace
> 	DW_AT_name: N
> 	DW_TAG_structure_type:
> 		DW_AT_name: A
> 
> and pull "N::A" out of this.
> Yay!

Can you post the GCC patches for generating namespace information
here?  That way, we can start working on GDB's support, and be ready
when GCC catches up.

(It seems to me that, if GCC is processing code that uses namespaces,
and generating mangled names and typeinfo objects that contain
prefixed names, but emitting Dwarf 2 information that has no record of
those prefixes, that should be called a GCC bug.  So it should be safe
to count on it getting fixed, whether or not using your patch.)

> In both the stabs (for all cases), and dwarf2 (for 3.0 compiled files only, 
> assuming it gets into 3.0.1), we could insert amazingly evil hacks to try 
> to seperate out the namespace from the demangled names on other real 
> members of the structure/type/whatever.

That does sound evil.

GDB has a tradition of accomodating broken debug info producers.  But
even when we can pin the problem on a specific version of the
compiler, those accomodations make the code harder to work with.  "If
I make this change, will it break our GCC 3.0 support?  I don't have
GCC 3.0 installed anywhere anymore..."

But until someone fixes stabs, I think it's reasonable to tell C++
users that GCC only provides sufficient information when using Dwarf
2.


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