libdw: Use correct CU to resolve file names in dwarf_decl_file.
authorMark Wielaard <mark@klomp.org>
Fri, 8 May 2020 10:33:11 +0000 (12:33 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 8 May 2020 15:47:12 +0000 (17:47 +0200)
commite1db5cdc9f230f8de4df1a0f38dca69b283ee57a
tree87eed4be05a4c19baa323e9dec6d714d58402f4a
parentb1d2404cc6ca0d9ce786e229a87c24db49163cfe
libdw: Use correct CU to resolve file names in dwarf_decl_file.

dwarf_decl_file uses dwarf_attr_integrate to get the DW_AT_decl_file
attribute. This means the attribute might come from a different DIE
in a different CU. If so, we need to use the CU associated with the
attribute, not the original DIE, to resolve the file name.

Also add a bit more documentation to dwarf_attr_integrate explaining
that the attribute returned might come from a different CU (and even
different Dwarf).

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/ChangeLog
libdw/dwarf_decl_file.c
libdw/dwarf_ranges.c
libdw/libdw.h
tests/ChangeLog
tests/Makefile.am
tests/run-allfcts.sh
tests/testfile-lto-gcc10.bz2 [new file with mode: 0755]