[Dwarf-discuss] class members and DW_AT_specification
Ron Brender
ron.brender@charter.net
Tue Feb 27 12:13:29 GMT 2007
Chris Quenelle wrote:
> g++ seems to generate two dies for each member function.
> A declaration die inside the class scope, and a definition
> die at the compilation-unit scope. The definition is hooked
> to the declaration with a DW_AT_specification, which seems fine.
>
> Is there some reading of the dwarf standard that might make this
> the required or recommended way of doing things? Or was this
> done for some kind of implementation-specific reason in
> either g++ or gdb?
>
> Anyone have any ideas?
>
> --chris
My reading of the DWARF standard is that use of separate spec and
definition DIEs is intended to correspond the use of separate
declaration and specifications in the source.
My speculation is that the g++ practice you describe reflects some kind
of normalization that occurs within the g++ implementation. Harmless but
unnecessary. At least I hope unnecessary because I would find it
unreasonable for gdb to depend on this practice for its operation. YMMV...
Ron
More information about the Dwarf-discuss
mailing list