20 uint64_t *OffsetPtr) {
26 "not enough space to extract a rangelist encoding");
27 uint8_t Encoding = Data.
getU8(OffsetPtr);
30 case dwarf::DW_RLE_end_of_list:
34 case dwarf::DW_RLE_base_addressx: {
35 uint64_t PreviousOffset = *OffsetPtr - 1;
40 "read past end of table when reading " 41 "DW_RLE_base_addressx encoding at offset 0x%" PRIx64,
45 case dwarf::DW_RLE_startx_endx:
47 "unsupported rnglists encoding DW_RLE_startx_endx at " 50 case dwarf::DW_RLE_startx_length: {
51 uint64_t PreviousOffset = *OffsetPtr - 1;
57 "read past end of table when reading " 58 "DW_RLE_startx_length encoding at offset 0x%" PRIx64,
62 case dwarf::DW_RLE_offset_pair: {
63 uint64_t PreviousOffset = *OffsetPtr - 1;
68 "read past end of table when reading " 69 "DW_RLE_offset_pair encoding at offset 0x%" PRIx64,
73 case dwarf::DW_RLE_base_address: {
76 "insufficient space remaining in table for " 77 "DW_RLE_base_address encoding at offset 0x%" PRIx64,
82 case dwarf::DW_RLE_start_end: {
85 "insufficient space remaining in table for " 86 "DW_RLE_start_end encoding " 87 "at offset 0x%" PRIx64,
93 case dwarf::DW_RLE_start_length: {
94 uint64_t PreviousOffset = *OffsetPtr - 1;
99 "read past end of table when reading " 100 "DW_RLE_start_length encoding at offset 0x%" PRIx64,
106 "unknown rnglists encoding 0x%" PRIx32
107 " at offset 0x%" PRIx64,
108 uint32_t(Encoding), *OffsetPtr - 1);
125 LookupPooledAddress)
const {
128 if (RLE.EntryKind == dwarf::DW_RLE_end_of_list)
130 if (RLE.EntryKind == dwarf::DW_RLE_base_addressx) {
131 BaseAddr = LookupPooledAddress(RLE.Value0);
133 BaseAddr = {RLE.Value0, -1ULL};
136 if (RLE.EntryKind == dwarf::DW_RLE_base_address) {
137 BaseAddr = {RLE.Value0, RLE.SectionIndex};
146 switch (RLE.EntryKind) {
147 case dwarf::DW_RLE_offset_pair:
148 E.
LowPC = RLE.Value0;
155 case dwarf::DW_RLE_start_end:
156 E.
LowPC = RLE.Value0;
159 case dwarf::DW_RLE_start_length:
160 E.
LowPC = RLE.Value0;
163 case dwarf::DW_RLE_startx_length: {
164 auto Start = LookupPooledAddress(RLE.Value0);
168 E.
LowPC = Start->Address;
183 raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
186 LookupPooledAddress)
const {
192 .
dump(OS, AddrSize, DumpOpts);
202 assert(!EncodingString.empty() &&
"Unknown range entry encoding");
203 OS <<
format(
" [%s%*c", EncodingString.data(),
204 MaxEncodingStringLength - EncodingString.size() + 1,
']');
205 if (
EntryKind != dwarf::DW_RLE_end_of_list)
210 case dwarf::DW_RLE_end_of_list:
211 OS << (DumpOpts.
Verbose ?
"" :
"<End of list>");
213 case dwarf::DW_RLE_base_addressx: {
214 if (
auto SA = LookupPooledAddress(
Value0))
215 CurrentBase = SA->Address;
220 OS <<
format(
" 0x%*.*" PRIx64, AddrSize * 2, AddrSize * 2,
Value0);
223 case dwarf::DW_RLE_base_address:
228 OS <<
format(
" 0x%*.*" PRIx64, AddrSize * 2, AddrSize * 2,
Value0);
230 case dwarf::DW_RLE_start_length:
231 PrintRawEntry(OS, *
this, AddrSize, DumpOpts);
234 case dwarf::DW_RLE_offset_pair:
235 PrintRawEntry(OS, *
this, AddrSize, DumpOpts);
237 .
dump(OS, AddrSize, DumpOpts);
239 case dwarf::DW_RLE_start_end:
242 case dwarf::DW_RLE_startx_length: {
243 PrintRawEntry(OS, *
this, AddrSize, DumpOpts);
245 if (
auto SA = LookupPooledAddress(
Value0))
uint64_t Value0
The values making up the range list entry.
This class represents lattice values for constants.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
An efficient, type-erasing, non-owning reference to a callable.
uint64_t Offset
The offset at which the entry is located in the section.
uint8_t EntryKind
The DWARF encoding (DW_RLE_* or DW_LLE_*).
uint64_t SectionIndex
The index of the section this entry belongs to.
Container for dump options that control which debug information will be dumped.
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
DWARFAddressRangesVector getAbsoluteRanges(Optional< object::SectionedAddress > BaseAddr, function_ref< Optional< object::SectionedAddress >(uint32_t)> LookupPooledAddress) const
Build a DWARFAddressRangesVector from a rangelist.
StringRef RangeListEncodingString(unsigned Encoding)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Error extract(DWARFDataExtractor Data, uint64_t End, uint64_t *OffsetPtr)
static ErrorSuccess success()
Create a success value.
void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength, uint64_t &CurrentBase, DIDumpOptions DumpOpts, llvm::function_ref< Optional< object::SectionedAddress >(uint32_t)> LookupPooledAddress) const
This file contains constants used for implementing Dwarf debug support.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
Optional< object::SectionedAddress > getAddrOffsetSectionItem(uint32_t Index) const
A class representing a single range list entry.
void dump(raw_ostream &OS, uint32_t AddressSize, DIDumpOptions DumpOpts={}, const DWARFObject *Obj=nullptr) const
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.