https://sourceware.org/bugzilla/show_bug.cgi?id=31111

Aaron Merey <amerey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amerey at redhat dot com
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #5 from Aaron Merey <amerey at redhat dot com> ---
Fixed in the following commit:

commit add63e0317b6e27dd4077b19e998e6c56a3becb5
Author: Aaron Merey <ame...@redhat.com>
Date:   Fri Feb 9 21:10:19 2024 -0500

    Handle DW_AT_decl_file 0

    Modify dwarf_decl_file to support DW_AT_decl_file with value 0.

    Because of inconsistencies in the DWARF 5 spec, it is ambiguous whether
    DW_AT_decl_file value 0 is a valid .debug_line file table index for the
    main source file or if it means that there is no source file specified.

    dwarf_decl_file interprets DW_AT_decl_file 0 as meaning no source file
    is specified.  This works with DWARF 5 produced by gcc, which duplicates
    the main source file name at index 0 and 1 of the file table and avoids
    using DW_AT_decl_file 0.

    However clang uses DW_AT_decl_file 0 for the main source index with no
    duplication at another index.  In this case dwarf_decl_file will be
    unable to find the file name of the main file.

    This patch changes dwarf_decl_file to treat DW_AT_decl_file 0 as a normal
    index into the file table, allowing it to work with DWARF 5 debuginfo
    produced by clang.

    As for earlier DWARF versions which exclusively use DW_AT_decl_file 0
    to indicate that no source file is specified, dwarf_decl_file will now
    return the name "???" if called on a DIE with DW_AT_decl_file 0.

    https://sourceware.org/bugzilla/show_bug.cgi?id=31111

    Signed-off-by: Aaron Merey <ame...@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to