diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp | |
parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) |
Notes
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp index f6785b89e86d..9ae4c5b73ebe 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp @@ -114,12 +114,21 @@ Error RangeListEntry::extract(DWARFDataExtractor Data, uint64_t End, DWARFAddressRangesVector DWARFDebugRnglist::getAbsoluteRanges( llvm::Optional<object::SectionedAddress> BaseAddr, DWARFUnit &U) const { + return getAbsoluteRanges(BaseAddr, [&](uint32_t Index) { + return U.getAddrOffsetSectionItem(Index); + }); +} + +DWARFAddressRangesVector DWARFDebugRnglist::getAbsoluteRanges( + Optional<object::SectionedAddress> BaseAddr, + function_ref<Optional<object::SectionedAddress>(uint32_t)> + LookupPooledAddress) const { DWARFAddressRangesVector Res; for (const RangeListEntry &RLE : Entries) { if (RLE.EntryKind == dwarf::DW_RLE_end_of_list) break; if (RLE.EntryKind == dwarf::DW_RLE_base_addressx) { - BaseAddr = U.getAddrOffsetSectionItem(RLE.Value0); + BaseAddr = LookupPooledAddress(RLE.Value0); if (!BaseAddr) BaseAddr = {RLE.Value0, -1ULL}; continue; @@ -152,7 +161,7 @@ DWARFAddressRangesVector DWARFDebugRnglist::getAbsoluteRanges( E.HighPC = E.LowPC + RLE.Value1; break; case dwarf::DW_RLE_startx_length: { - auto Start = U.getAddrOffsetSectionItem(RLE.Value0); + auto Start = LookupPooledAddress(RLE.Value0); if (!Start) Start = {0, -1ULL}; E.SectionIndex = Start->SectionIndex; |