I ran a gdb-local script using pyelftools on all the executables in a gdb testsuite build directory, and submitted fixes for that script, fixing python exceptions.
One such fix works around this corner-case:
<2><335>: Abbrev Number: 8 (DW_TAG_variable)
<336> DW_AT_name : p
<338> DW_AT_location : 6 byte block: f2 14 3 0 0 0 \
(DW_OP_GNU_implicit_pointer: <0x314> 0)
Pyelftools complains:
elftools.common.exceptions.ELFParseError: expected 8, found 5
The DW_OP_GNU_implicit_pointer has two arguments, a reference and an offset.
Pyelftools expects an 8-byte reference, but instead finds a 4-byte reference.
The DWARF is correct, it's a cornercase of using DW_OP_GNU_implicit_pointer in DWARF v2, where DW_FORM_ref_addr references have the same size as an address on the target system, something that was changed in DWARF v3.
I ran a gdb-local script using pyelftools on all the executables in a gdb testsuite build directory, and submitted fixes for that script, fixing python exceptions.
One such fix works around this corner-case:
Pyelftools complains:
The DW_OP_GNU_implicit_pointer has two arguments, a reference and an offset.
Pyelftools expects an 8-byte reference, but instead finds a 4-byte reference.
The DWARF is correct, it's a cornercase of using DW_OP_GNU_implicit_pointer in DWARF v2, where DW_FORM_ref_addr references have the same size as an address on the target system, something that was changed in DWARF v3.