On Thu, Nov 02, 2023 at 06:04:27PM +0100, Mark Wielaard wrote: > Hi Omar, > > On Wed, 2023-09-27 at 11:20 -0700, Omar Sandoval wrote: > > libdw and libdwfl currently save the path of the directory containing > > the ELF file to use when searching for alt and dwo files. To search for > > dwp files, we need the file name too. Add an elfpath field to Dwarf, > > and set the debugdir field from it. Also update libdwfl to set elfpath > > and debugdir. > > This looks good. We will need some locking around this code when we > integrate the thread-safety work. But that should be pretty clear. > > > > > Signed-off-by: Omar Sandoval <osan...@fb.com> > > --- > > libdw/ChangeLog | 11 ++++++++++- > > libdw/dwarf_begin_elf.c | 34 ++++++++++++++++++++-------------- > > libdw/dwarf_end.c | 3 ++- > > libdw/libdwP.h | 12 ++++++++++-- > > libdwfl/ChangeLog | 9 +++++++++ > > libdwfl/dwfl_module.c | 2 +- > > libdwfl/dwfl_module_getdwarf.c | 11 +++++++---- > > libdwfl/libdwflP.h | 2 +- > > libdwfl/offline.c | 4 ++-- > > 9 files changed, 62 insertions(+), 26 deletions(-) > > > > diff --git a/libdw/ChangeLog b/libdw/ChangeLog > > index 1d229094..f491587f 100644 > > --- a/libdw/ChangeLog > > +++ b/libdw/ChangeLog > > @@ -20,7 +20,7 @@ > > instead of dbg parameter, which is now unused. > > * libdwP.h (Dwarf_Macro_Op_Table): Replace is_64bit with address_size > > and offset_size. Add dbg. > > - (Dwarf): Add cu_index and tu_index. > > + (Dwarf): Add cu_index and tu_index. Add elfpath. > > (Dwarf_CU): Add dwp_row. > > (Dwarf_Package_Index): New type. > > (DW_SECT_TYPES): New macro. > > @@ -28,6 +28,9 @@ > > (dwarf_cu_dwp_section_info): New INTDECL. > > Add IDX_debug_cu_index and IDX_debug_tu_index. Add > > DWARF_E_UNKNOWN_SECTION. > > + (__libdw_debugdir): Replace declaration with... > > + (__libdw_elfpath): New declaration. > > + (__libdw_set_debugdir): New declaration. > > * dwarf_begin_elf.c (dwarf_scnnames): Add IDX_debug_cu_index and > > IDX_debug_tu_index. > > (scn_to_string_section_idx): Ditto. > > @@ -35,8 +38,14 @@ > > .zdebug_cu_index, and .zdebug_tu_index. > > (check_section): Change .dwo suffix matching to account for > > .debug_cu_index and .debug_tu_index. > > + (__libdw_debugdir): Replace with.. > > + (__libdw_elfpath): New function. > > + (__libdw_set_debugdir): New function. > > + (valid_p): Call __libdw_elfpath and __libdw_set_debugdir instead of > > + __libdw_debugdir. > > * Makefile.am (libdw_a_SOURCES): Add dwarf_cu_dwp_section_info.c. > > * dwarf_end.c (dwarf_end): Free dwarf->cu_index and dwarf->tu_index. > > + Free dwarf->elfpath. > > * dwarf_error.c (errmsgs): Add DWARF_E_UNKNOWN_SECTION. > > * libdw.h (dwarf_cu_dwp_section_info): New declaration. > > * libdw.map (ELFUTILS_0.190): Add dwarf_cu_dwp_section_info. > > I had to recreate the ChangeLog entry because we skipped your patch 08. > In the future lets just move the ChangeLog Entry into the commit > message (we just updated CONTRIBUTING to recommend this). That makes > rebasing slightly
Thanks for updating that, that's so much easier to work with :)