Objdump: New feature display of global variable information based on DWARF info section

Guillaume VACHERIAS guillaume.vacherias@foss.st.com
Fri Sep 26 12:22:27 GMT 2025


Hello Jan,

I've made some adjustement to the test to make the ordering independant. It
should now failed if an unexpected output is given and is now order
independant.

Changes since v1:
- Added new prerequisite patch to better handle call and use sites.
- Change function process_debug_info arguments bool to unsigned int.
- Change option name to "--map-global-vars" instead of "-Y/--map-file".
- Added information on DWARF dependencues of this option.
- Correct switch-case braces alignment.
- Correct type of structure container field holding DW_AT_name from
(unsigned char *) to plain text (char *).
- Change to sizeof (<expression>) to avoid risk of variable's types being
changed.
- Replace error messages with asserts.
- Rename enumeration identifier UNKNOWN to UNKNWON_TYPE to be less generic.
- Remove unnecessary typedef aliases.

Changes since v2:
- Fix defines DO_LOC and DO_TYPES values to lower-case x-exes.
- Correctly set and clear do_flags anew.
- Remove unnecessary parenthesis.

Changes since v3:
- Introduce `generic_type` structure which generalize all structure
containers. `generic_type` will serve as linked list to contain different type
of DWARF informaation.
- Introduce `generic_type_l` structure for element insertion at tail of list.
- Use tail and head pointers as well for enumeration and subrange contents.
- Changed get_or_create_<structure> as well as free_<structure> function to
match with new structure `generic_type`.
- Changed objdump.exp test to ensure that DWARF2 is used and order of display
of information does not matter.

Changes since v4:
- Test in binutils/testsuite/binutils-all/objdump.exp leverage order dependance
of output matching.

Guillaume.




More information about the Binutils mailing list