mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
[DWARF parser] Refactor fetching DIE address ranges.
Add a helper method to get address ranges specified in a DIE (either by DW_AT_low_pc/DW_AT_high_pc, or by DW_AT_ranges). Use it to untangle and simplify the code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user