34 if (!
data.isValidOffset(*offset_ptr))
36 "invalid range list offset 0x%" PRIx64, *offset_ptr);
38 AddressSize =
data.getAddressSize();
41 "range list at offset 0x%" PRIx64, *offset_ptr))
49 Entry.StartAddress =
data.getRelocatedAddress(offset_ptr);
51 data.getRelocatedAddress(offset_ptr, &Entry.SectionIndex);
54 if (*offset_ptr != prev_offset + 2 * AddressSize) {
57 "invalid range list entry at offset 0x%" PRIx64,
60 if (Entry.isEndOfListEntry())
62 Entries.push_back(Entry);
69 switch (AddressSize) {
71 AddrFmt =
"%08" PRIx64
" %04" PRIx64
" %04" PRIx64
"\n";
74 AddrFmt =
"%08" PRIx64
" %08" PRIx64
" %08" PRIx64
"\n";
77 AddrFmt =
"%08" PRIx64
" %016" PRIx64
" %016" PRIx64
"\n";
83 OS <<
format(AddrFmt, Offset, RLE.StartAddress, RLE.EndAddress);
84 OS <<
format(
"%08" PRIx64
" <End of list>\n", Offset);
88 std::optional<object::SectionedAddress> BaseAddr)
const {
94 if (RLE.isBaseAddressSelectionEntry(AddressSize)) {
95 BaseAddr = {RLE.EndAddress, RLE.SectionIndex};
100 E.
LowPC = RLE.StartAddress;
103 E.HighPC = RLE.EndAddress;
104 E.SectionIndex = RLE.SectionIndex;
111 E.LowPC += BaseAddr->Address;
112 E.HighPC += BaseAddr->Address;
113 if (E.SectionIndex == -1ULL)
114 E.SectionIndex = BaseAddr->SectionIndex;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
LocallyHashedType DenseMapInfo< LocallyHashedType >::Tombstone
static Error checkAddressSizeSupported(unsigned AddressSize, std::error_code EC, char const *Fmt, const Ts &...Vals)
static bool isAddressSizeSupported(unsigned AddressSize)
LLVM_ABI Error extract(const DWARFDataExtractor &data, uint64_t *offset_ptr)
LLVM_ABI DWARFAddressRangesVector getAbsoluteRanges(std::optional< object::SectionedAddress > BaseAddr) const
getAbsoluteRanges - Returns absolute address ranges defined by this range list.
LLVM_ABI void dump(raw_ostream &OS) const
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint64_t computeTombstoneAddress(uint8_t AddressByteSize)
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
uint64_t SectionIndex
A section index this range belongs to.
LLVM_ABI bool isBaseAddressSelectionEntry(uint8_t AddressSize) const
A base address selection entry consists of:
uint64_t StartAddress
A beginning address offset.