[PATCH 3/4] libdw: Make dwarf_srclang forward compatible with DW_AT_language_name

2025-03-11 Thread Mark Wielaard
For programs which use dwarf_srclang it might be useful to translate a DW_LNAME (plus version) into a DW_LANG constant if there is no DW_AT_language constant, but there is a DW_AT_language_name (and DW_AT_language_version). * libdw/dwarf_srclang.c (language_to_srclang): New function.

[PATCH 4/4] readelf: Add support for printing DW_AT_language_name DW_LNAMEs

2025-03-11 Thread Mark Wielaard
Add a testfile using GCC 15 (experimental). * libdw/dwarf.h: Add DW_LNAME_lo_user and DW_LNAME_hi_user. * src/readelf.c (dwarf_lname_string): New function. (dwarf_lname_name): Likewise. (attr_callback): Handle DW_AT_language_name by calling dwarf_lname_

[PATCH 1/4] dwarf.h: Add DWARF v6 langauge attributes and DW_LNAME constants

2025-03-11 Thread Mark Wielaard
https://dwarfstd.org/languages-v6.html defines the DWARF v6 language attributes, DW_AT_language_name, DW_AT_language_version and DW_LNAME constants as usable by pre-DWARF v6 producers and consumers. Also add new DW_LANG_V and DW_LANG_Algol68 (DWARFv5) language constants. * config/known-dwarf.