generate: add support DW_TAG_unspecified_type #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GAS 2.40 and later add return type tag to DWARF DIEs generated for function symbols, introduced in [1]
This is compliant with the DWARFv5 stardard [2], Sec. 3.3.2 and Sec. 5.2. The resulting DW_TAG_subprogram then has a DW_AT_type attribute pointing to a DW_TAG_unspecified_type. For example,
emits
As is, when processing DW_TAG_subprogram (print_die_subprogram), kabi-dw calls print_die_tag to determine the return type and fail on an unsupported DW_TAG:
This commit adds a new DW_TAG_unspecified_type case to said function's processing and treats it as a new "basetype" named "auto".
This corresponds to the following file func--entry_ibpb.txt:
[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5578fbf672ee497ea19826edeb509f4cc3e825a8
[2] https://dwarfstd.org/doc/DWARF5.pdf
unspecified
was also considered, butauto
might be more suggestive in that it is a keyword in other languages, might become a reserved C keyword, and (not that it's relevant) C++ emits the same tag for its auto return values; but I am certainly open to better naming suggestions...