Issue 211108.1: Add DW_AT_artificial for DW_TAG_typedef
|Hafiz Abid Qadeer
Currently, there is no way to specify that a typedef is artificially generated
by the compiler. This is particularly useful when a typedef is built-in into
the compiler, and no DECL is defined. To avoid using 0 on DECL attributes,
DW_AT_artificial should be available to tell the debuggers that this typedef
Real-world cases where I see this applicable are compilers that generate C standard typedefs to speed up a compilation or typedef members inside of generated structs that are composed by other derivate types with an opaque pointer. An example of these data types is D associative array structs that contain an opaque pointer matching a key and value typedef.
The DWARF specification can also be revised to accommodate the
attribute on other tags.
DW_AT_artificial attribute is already allowed on
so no change is strictly necessary. However, this could be made clearer
by revising Appendix A to state that it can be used with any tag, and
removing it from the handful of tags where it is explicitly listed.
(page 251) Add a new bullet at the end with this text
DW_AT_artificialattribute can be used with any declarative debugging information entry. For simplicity, this attribute is not shown.
DW_AT_artificial from the following tags in Table A.1 (Attributes by Tag):
2023-05-15: Will revise proposal to specifically allow
for all DIEs.
2023-06-09: Revised. Changed from Enhancement to Clarification.