Skip to content

Commit

Permalink
Lookup DIE location with dwarf_offdie when parsing ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Nov 10, 2023
1 parent a1fab34 commit d4d42a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dwarf/h/dwarf_cu_info.h
Expand Up @@ -97,6 +97,12 @@ namespace Dyninst { namespace DwarfDyninst {
*
*/
inline Dwarf_Die *find_cu(Dwarf *dbg, Dwarf_Addr addr, Dwarf_Die *result) {
// The .debug_info DIE offset is the starting address for modules.
if(dwarf_offdie(dbg, addr, result)) {
return result;
}

// Search for the given address (assumes .debug_aranges is present)
Dwarf_Die cuDIE{};
if (dwarf_addrdie(dbg, addr, &cuDIE)) {
*result = cuDIE;
Expand Down

0 comments on commit d4d42a4

Please sign in to comment.