[Dwarf-Discuss] D.4 Member Function Example
mjw at redhat.com
Tue Apr 22 03:11:37 PDT 2014
I was looking at the D.4 Member Function Example and noticed it flags
member functions that don't return a value with a DW_AT_type pointing to
a DW_TAG_unspecified_type with name "void". I haven't encountered
producers that do this and it seems 5.5.7 Member Function Entries imply
that DW_TAG_subprogram member function DIEs follow the same rules as
non-member DW_TAG_subprogram function DIEs. Where 3.3.2 says:
If the subroutine or entry point is a function that returns a
value, then its debugging information entry has a DW_AT_type
attribute to denote the type returned by that function.
Debugging information entries for C void functions should not
have an attribute for the return type.
Was the example intended to show that a void function that doesn't
return a value could still have a DW_AT_type and that it should point to
a "void" DW_TAG_unspecified_type (are there producers out there which
encode void member functions this way)? Or is it just an unfortunate
example that doesn't represent the best practice of what the spec
intended for no return value member functions? I can submit a
clarification request in that case.
More information about the Dwarf-Discuss