libdw: Support DW_OP_addrx/constx and split DWARF addrx/constx support.
authorMark Wielaard <mark@klomp.org>
Sun, 20 May 2018 21:30:01 +0000 (23:30 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 25 May 2018 13:07:58 +0000 (15:07 +0200)
commit6e3d2521a2b5a3b436901f52cfb9785887a7c961
tree649d9c157ac680e9f99b61df772e429883602bf5
parent184fd30d1a453dc165ffc187b22dec6d196522ad
libdw: Support DW_OP_addrx/constx and split DWARF addrx/constx support.

DW_OP_addrx/constx and GNU DebugFission DW_OP_GNU_addr/const_index take
as argument an index into the .debug_addr section for the associated CU.
This index gets resolved through dwarf_getlocation_attr. A new fake addr
CU is created per Dwarf for use with this new attribute. For split DWARF
files, the IDX_debug_addr gets replaced with the skeleton section and the
addr base is resolved immediately when constructing the split DWARF CU.
Move __libdw_cu_addr_base to libdwP.h to share with eu-readelf. Also
make it possible to resolve addrx[1234]/GNU_addr_index also as constant
indexes to (also) show when displaying these attributes in eu-readelf.

A new varlocs tests is added to test the resolving for both the DWARF4
and DWARF5 DW_OP variants. And now that addrx forms are resolved in
split DWARF files add the new DIEs with "single ranges" (those DIEs that
have a lowpc/highpc attribute pair) to run-all-dwarf-ranges.sh.

Signed-off-by: Mark Wielaard <mark@klomp.org>
19 files changed:
libdw/ChangeLog
libdw/dwarf_begin_elf.c
libdw/dwarf_end.c
libdw/dwarf_formaddr.c
libdw/dwarf_formudata.c
libdw/dwarf_getlocation_attr.c
libdw/libdwP.h
libdw/libdw_find_split_unit.c
src/ChangeLog
src/readelf.c
tests/ChangeLog
tests/Makefile.am
tests/addrx_constx-4.dwo.bz2 [new file with mode: 0644]
tests/addrx_constx-5.dwo.bz2 [new file with mode: 0644]
tests/run-all-dwarf-ranges.sh
tests/run-varlocs.sh
tests/testfile-addrx_constx-4.bz2 [new file with mode: 0755]
tests/testfile-addrx_constx-5.bz2 [new file with mode: 0755]
tests/varlocs.c