[Dwarf-Discuss] regarding DW_TAG_subroutine_type usage
Roland McGrath
roland@redhat.com
Tue Sep 8 07:32:40 GMT 2009
DW_TAG_subroutine_type is for a function type, not a particular function.
You may be looking for DW_TAG_subprogram, which is the entry for a function,
rather than for a function type. (Note the DW_AT_type attribute of a
DW_TAG_subprogram is that function's return type, not the function type.)
Ordinarily in C and C++, function types do not get names. Rather, there
might be a named DW_TAG_typedef that points to a function type, or another
unnamed type entry like a DW_TAG_pointer_type that points to one.
An enum, struct, or class entry will have a DW_AT_name if it does in the
source, but none for e.g. "enum { a, b };" or "struct { int x; } ...".
Also note that any particular entry will sometimes lack DW_AT_name and
other attributes you might expect, if it's a derived entry with a
DW_AT_abstract_origin or DW_AT_specification attribute pointing to another
entry where DW_AT_name might be found.
Thanks,
Roland
More information about the Dwarf-discuss
mailing list