Bug 497130

Summary: Recognize new DWARF5 DW_LANG constants
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Mark Wielaard <mark>
Status: RESOLVED FIXED    
Severity: normal CC: ahajkova
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Recognize new DWARF5 DW_LANG constants

Description Mark Wielaard 2024-12-06 14:48:32 UTC
When using --read-var-info=yes readdwarf3 will try to read and
interpret the CU DW_AT_langauge attribute. Since DWARF5 was released a
number if new language constants have been introduced. See
https://dwarfstd.org/languages.html

GCC15 might start emitting some of these when switching to C23 by
default.

When valgrind --read-var-info=yes encounters an unknown DW_LANG
constant it will produce an error and stop processing any further
DWARF.
Comment 1 Mark Wielaard 2024-12-06 14:51:15 UTC
Created attachment 176395 [details]
Recognize new DWARF5 DW_LANG constants

Recognize all currently known language constants. In particular
recognize DW_LANG_C17, DW_LANG_C23, DW_LANG_C_plus_plus_17,
DW_LANG_C_plus_plus_20, DW_LANG_C_plus_plus_23, DW_LANG_Fortran18,
DW_LANG_Fortran23, DW_LANG_Ada2005, DW_LANG_Ada2012 and DW_LANG_Rust.
Comment 2 Mark Wielaard 2024-12-09 12:12:08 UTC
commit 7136316123c54aba37fdab166e1bf860e452a4ae
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Dec 6 15:39:25 2024 +0100

    Recognize new DWARF5 DW_LANG constants
    
    When using --read-var-info=yes readdwarf3 will try to read and
    interpret the CU DW_AT_langauge attribute. Since DWARF5 was released a
    number if new language constants have been introduced. See
    https://dwarfstd.org/languages.html
    
    GCC15 might start emitting some of these when switching to C23 by
    default.
    
    When valgrind --read-var-info=yes encounters an unknown DW_LANG
    constant it will produce an error and stop processing any further
    DWARF.
    
    Recognize all currently known language constants. In particular
    recognize DW_LANG_C17, DW_LANG_C23, DW_LANG_C_plus_plus_17,
    DW_LANG_C_plus_plus_20, DW_LANG_C_plus_plus_23, DW_LANG_Fortran18,
    DW_LANG_Fortran23, DW_LANG_Ada2005, DW_LANG_Ada2012 and DW_LANG_Rust.
    
    https://bugs.kde.org/show_bug.cgi?id=497130
Comment 3 Mark Wielaard 2024-12-09 13:21:07 UTC
Also added to the VALGRIND_3_24_BRANCH