This is the mail archive of the
mailing list for the GDB project.
Re: Handling of c++ function members
On Mon, 2011-09-26 at 16:38 -0400, Daniel Jacobowitz wrote:
> On Mon, Sep 26, 2011 at 12:46 PM, Joost van der Sluis <email@example.com> wrote:
> > Hi all,
> > I've been looking at the code which handles calling c++ function members
> > and the Dwarf specifications. Is came to the conclusion that gcc does
> > not generate valid Dwarf-debuginfo for those function members, but a
> > work-around which is also implemented in gdb, namely in gnu-v2-abi.c.
> > Is my conclusion right?
> Can you be a little more specific, maybe an example?
> There are definitely oddities in the GCC debug info, but the
> workarounds I remember are in the DWARF reader.
Problem is that I'm not sure is I read the Dwarf-spec's regarding
function members correctly.
What I understood is, that DW_AT_vtable_elem_location should contain a
Dwarf-block that calculates the location of a pointer in which the
location of the function member is stored.
But it seems to me that gcc stores the index of the function member
within some vtable in DW_AT_vtable_elem_location, instead of the memory
address itself. In gnu-v2-abi.c there is some code that 'knows' how this
vtable is organized so it is able to calculate the location of the
And there are two thing's I'm not sure about: gcc stores
DW_AT_containing_type in the debug-info, with the 'parent' entry of the
DW_TAG_subprogram entry. To me it looks that this is duplicated
information, and not specified in the Dwarf-specs. Secondly I do not
understand where the DW_AT_object_pointer is used for?