diff options
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugRangeList.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugRangeList.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugRangeList.cpp b/llvm/lib/DebugInfo/DWARFDebugRangeList.cpp index aa2a2be5990..07b23b32d1f 100644 --- a/llvm/lib/DebugInfo/DWARFDebugRangeList.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugRangeList.cpp @@ -54,13 +54,16 @@ void DWARFDebugRangeList::dump(raw_ostream &OS) const { OS << format("%08x <End of list>\n", Offset); } -bool DWARFDebugRangeList::containsAddress(uint64_t BaseAddress, - uint64_t Address) const { +DWARFAddressRangesVector +DWARFDebugRangeList::getAbsoluteRanges(uint64_t BaseAddress) const { + DWARFAddressRangesVector Res; for (const RangeListEntry &RLE : Entries) { - if (RLE.isBaseAddressSelectionEntry(AddressSize)) + if (RLE.isBaseAddressSelectionEntry(AddressSize)) { BaseAddress = RLE.EndAddress; - else if (RLE.containsAddress(BaseAddress, Address)) - return true; + } else { + Res.push_back(std::make_pair(BaseAddress + RLE.StartAddress, + BaseAddress + RLE.EndAddress)); + } } - return false; + return Res; } |