This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: DW_AT_specification and partial symtabs
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: David Carlton <carlton at kealia dot com>
- Cc: gdb <gdb at sources dot redhat dot com>, Elena Zannoni <ezannoni at redhat dot com>,Jim Blandy <jimb at redhat dot com>
- Date: Thu, 12 Jun 2003 13:05:45 -0400
- Subject: Re: DW_AT_specification and partial symtabs
- References: <m3el1zfcwd.fsf@dhcp-10-42-69-238.kealia.com>
On Thu, Jun 12, 2003 at 10:01:38AM -0700, David Carlton wrote:
> One of the main issues that I'm dealing with on my branch is getting
> nested types to work right in C++ (with DWARF 2): these have the
> characteristic that they depend on the hierarchical structure of the
> debug info to a greater extent than, as far as I can tell, anything
> that mainline GDB currently does. The reason for this is that, to
> deduce a nested type's name, you really have to know where it lives in
> the hierarchical structure, so you can add whatever prefixes are
> appropriate to its DW_AT_name. (With non-types, we (over)use mangled
> names for this sort of thing, so it's not such a big deal there.)
> Unfortunately, there's no way to get at that information at all with
> the current psymtab reader: it tries to march from top-level DIE to
> top-level DIE without building up a tree of DIEs. So it seems to me
> that I have no choice but to have the psymtab reader build up a tree
> of DIEs before it starts reading, just like the symtab reader does.
>
> Comments? Suggestions? Ideas for how to make the tree that the
> psymtab reader builds to be as small as possible? I'm a little
> worried about weird cases like local classes: if I have
I'll answer this in more depth in a bit. For now, something to
consider: I would like to add .debug_typenames (spelling?) to GCC -
it's an SGI extension, IIRC. This plus .debug_pubnames should allow us
to implement psymtabs entirely without mapping .debug_info. I believe
it handles your case too, since it should have fully qualified
typenames.
The implementation may need a little tweaking for space efficiency...
> void foo ()
> {
> class Local {
> public:
> int mem() {return 1;}
> };
>
> ...
> }
>
> then is the compiler allowed to put a definition of Local::mem as a
> child of the comp unit die (with a DW_AT_specification pointing to a
> DIE inside of foo somewhere)?
I believe so.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer