|
DWARF Standard
|
190407.2 |
Shawn Landden |
Allow debug functions that clarify which of a union is valid. |
Enhancement |
Incomplete |
Eric Christopher |
Section 5.7, pg 113
In some large code bases I work on (such as Zig's stage1 compiler), there is
a structure with a large union, of which only one is valid at a certain time,
and clarified based on an ID attribute. It would be nice if the DWARF standard
could clarify a way that the program could provide a clarifying function that
would say which option of the union is valid at any certain time.
While this function that gets called would be hard to write in C or C++ (and
the compiler doesn't have enough information to figure this out), as there is
not much introspection abilities, in Zig it would be easy, and it would improve
the utility of the debugger.