]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw: Try .dwp file in __libdw_find_split_unit()
authorOmar Sandoval <osandov@fb.com>
Wed, 6 Dec 2023 09:22:17 +0000 (01:22 -0800)
committerMark Wielaard <mark@klomp.org>
Thu, 15 Feb 2024 22:22:51 +0000 (23:22 +0100)
commitcdce659558cb5ea63223b2f90f47f36e64980edb
treed8aa47efc85317fb03fe29b5bee733802eae250d
parent985112bc7d0f4eabbaa8a33fdcb241832db54642
libdw: Try .dwp file in __libdw_find_split_unit()

Try opening the file in the location suggested by the standard (the
skeleton file name + ".dwp") and looking up the unit in the package
index.  The rest is similar to .dwo files, with slightly different
cleanup since a single Dwarf handle is shared.

* libdw/libdw_find_split_unit.c (try_dwp_file): New function.
(__libdw_find_split_unit): Call try_dwp_file.
* libdw/libdwP.h (Dwarf): Add dwp_dwarf and dwp_fd.
(__libdw_dwp_findcu_id): New declaration.
(__libdw_link_skel_split): Handle .debug_addr for dwp.
* libdw/libdw_begin_elf.c (dwarf_begin_elf): Initialize
result->dwp_fd.
* libdw/dwarf_end.c (dwarf_end): Free dwarf->dwp_dwarf and close
dwarf->dwp_fd.
(cu_free): Don't free split dbg if it is dwp_dwarf.

Signed-off-by: Omar Sandoval <osandov@fb.com>
libdw/dwarf_begin_elf.c
libdw/dwarf_cu_dwp_section_info.c
libdw/dwarf_end.c
libdw/libdwP.h
libdw/libdw_find_split_unit.c