Yes, assuming that the compiler generates a valid source type.
cases, particularly with template classes, this may not be the case.
So DWARF does not give any guarantees and it's up to compiler
vendor to decide about DW_AT_name?
DWARF doesn't give guarantees, just suggestions. Practically speaking
there's certainly benefit to compilers ensuring they produce a
consistent name across different translation units - and potentially
even a consistent name across compilers (so that code built with
different compilers and then debugged can behave consistently/well). (or
consistent enough for a debugger to cope with it - but I think as Daniel
pointed out, having the debugger have to decompose the name and do
various type equivalences is painful - which might lean one towards
trying to produce more consistent names across GCC and Clang - the few
cases I know of (enums, for example) could probably be improved just for
the compiler self-consistency aspect and incidentally improve the cross
compiler consistency anyway)
Exactly. In many areas, the DWARF Standard is permissive. There are
specific constraints which are mentioned, but the producer is given a
lot of latitude whether to generate complete or incomplete, good or poor
DWARF. DWARF guarantees the organization and structure of the data.
There is a comment about names on the DWARF Wiki under Best Practices:
Michael Eager ea...@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306
Dwarf-Discuss mailing list