Re: [Core] [RFC] dwarf debug information: Handle Free Pascal virtual table indexes

Jonas Maebe
2010-05-13T21:14:14Z

On 13 May 2010, at 22:53, Tom Tromey wrote:

>>>>>> "Jonas" == Jonas Maebe <jonas.maebe@elis.ugent.be> writes:
>
> Jonas> I based that on what I saw gcc 4.0 (and 4.2) generate under Mac
> Jonas> OS X for a virtual C++ method:
>
> Thanks for pointing this out. It turns out that g++ is also doing the
> wrong thing. I filed this today after asking Jason about it:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44126
>
> So I guess we can safely try to reuse the existing C++ branch in the
> DWARF reader for the Pascal case.

I agree. And I assume it is currently not used because we don't generate an AT_containing_type attribute (because that's used by GDB's DWARF parser to initialise fnp->fcontext). That should not be too difficult to add, but I'm not sure what it's doing in the debug info as part of a TAG_subprogram.

As far as I can see, it's only defined by the DWARF3 spec for DW_TAG_ptr_to_member_type entries (which are not supported by GDB, and I'm not entirely sure about what their purpose is). Both GCC and FPC put all method declarations as childs of the containing type's TAG_structure_type, so I think that the context is implicit anyway.

Jonas