]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw: Make dwarf_srclang forward compatible with DW_AT_language_name
authorMark Wielaard <mark@klomp.org>
Sun, 9 Mar 2025 01:50:24 +0000 (02:50 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 10 Mar 2025 19:41:31 +0000 (20:41 +0100)
commitcbfa885f32a8e18a679f530a8a9910f6cb262273
tree1cac64b61398f33762b04c89c9d3ae77c2915d58
parent48f32e91524119ef40bce33b1bcc7b6687f9a892
libdw: Make dwarf_srclang forward compatible with DW_AT_language_name

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.
(dwarf_srclang): If there is no DW_AT_language, try
DW_AT_language_name and DW_AT_language_version, use
language_to_srclang.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/dwarf_srclang.c