Patch 2 doesn't handle DW_AT_GNU_addr_base, DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index. But those are only used as extensions to DWARF4 with split-dwarf. Support could be added later if people really use pre-DWARF5 split-dwarf.
setup_cu_bases could check for cc->version >= 5 to prevent some work for older DWARF, but it is probably not noticeable.
read dwarf5 DW_FORM_addrx* and DW_FORM_strx* as generated by Clang14
DW_FORM_addrx* are offsets into .debug_addr containing addresses.
DW_FORM_strx* are offsets into .debug_str_offsets, which contain
offsets into .debug_str. Support for these also requires reading
DW_AT_addr_base and DW_AT_str_offsets_base before any other field
in the abbrev table entry, as those may use this form.
Patch 2 doesn't handle DW_AT_GNU_ addr_base, DW_FORM_ GNU_addr_ index and DW_FORM_ GNU_str_ index. But those are only used as extensions to DWARF4 with split-dwarf. Support could be added later if people really use pre-DWARF5 split-dwarf.
setup_cu_bases could check for cc->version >= 5 to prevent some work for older DWARF, but it is probably not noticeable.
Looks good. Pushed as:
commit 61dfba4232d795c 00603c74e6d0573 f2d16641e2
Author: Luboš Luňák <email address hidden>
Date: Tue Apr 19 11:14:52 2022 +0200
read dwarf5 DW_FORM_addrx* and DW_FORM_strx* as generated by Clang14
DW_FORM_addrx* are offsets into .debug_addr containing addresses. offsets_ base before any other field
DW_FORM_strx* are offsets into .debug_str_offsets, which contain
offsets into .debug_str. Support for these also requires reading
DW_AT_addr_base and DW_AT_str_
in the abbrev table entry, as those may use this form.