[PATCH v3 2/4] libdw: Refactor dwarf_next_lines and fix skipped CU

2024-02-26 Thread Omar Sandoval
From: Omar Sandoval dwarf_next_lines has two loops over CUs: one from the CU after the given CU to the end, and one from the first CU up to _but not including_ the given CU. This means that the given CU is never checked. This is unlikely to matter in practice since CUs usually correspond 1:1 wi

[PATCH v3 4/4] libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file indexes

2024-02-26 Thread Omar Sandoval
From: Omar Sandoval Meta uses DWARF package files for our large, statically-linked C++ applications. Some of our largest applications have more than 4GB in .debug_info.dwo, but the section offsets in .debug_cu_index and .debug_tu_index are 32 bits; see the discussion here [1]. We implemented a

[PATCH v3 3/4] libdw: Apply DWARF package file section offsets where appropriate

2024-02-26 Thread Omar Sandoval
From: Omar Sandoval The final piece of DWARF package file support is that offsets have to be interpreted relative to the section offset from the package index. .debug_abbrev.dwo is already covered, so sprinkle around calls to dwarf_cu_dwp_section_info for the remaining sections: .debug_line.dwo,

[PATCH v3 1/4] libdw: Handle split DWARF in dwarf_decl_file

2024-02-26 Thread Omar Sandoval
From: Omar Sandoval Calling dwarf_decl_file on a split DWARF DIE fails this assertion: dwarf_decl_file.c:72: dwarf_decl_file: Assertion `cu->files != NULL && cu->files != (void *) -1l' failed. This is because dwarf_decl_file calls dwarf_getsrclines to populate cu->files. For normal units, c

[PATCH v3 0/4] elfutils: DWARF package (.dwp) file support

2024-02-26 Thread Omar Sandoval
From: Omar Sandoval Hi, This is version 3 of my patch series adding support for DWARF package files to libdw and the elfutils tools. Version 2 is here [1], and version 1 is [here]. This version fixes handling of line number information. Patches 1 and 2 are new in this version. Patch 1 fixes dwa

Re: [PATCH v2 3/4] libdw: Apply DWARF package file section offsets where appropriate

2024-02-26 Thread Omar Sandoval
On Sat, Feb 24, 2024 at 03:00:04PM +0100, Mark Wielaard wrote: > Hi Omar, > > On Thu, Feb 22, 2024 at 05:03:44PM -0800, Omar Sandoval wrote: > > On Thu, Feb 22, 2024 at 04:53:19PM -0800, Omar Sandoval wrote: > > > On Fri, Feb 16, 2024 at 04:00:47PM +0100, Mark Wielaard wrote: > > > > Don't we also

[PATCH] Add __libdw_getdieranges

2024-02-26 Thread Aaron Merey
__libdw_getdieranges builds an aranges list by iterating over CUs and recording each address range. __libdw_getdieranges provides an alternative to relying on .debug_aranges for address ranges, since this section might be absent or incomplete. https://sourceware.org/bugzilla/show_bug.cgi?id=22288