27 "not enough space to extract a rangelist encoding");
28 uint8_t Encoding = Data.
getU8(OffsetPtr);
31 case dwarf::DW_RLE_end_of_list:
35 case dwarf::DW_RLE_base_addressx: {
36 uint32_t PreviousOffset = *OffsetPtr - 1;
41 "read past end of table when reading " 42 "DW_RLE_base_addressx encoding at offset 0x%" PRIx32,
46 case dwarf::DW_RLE_startx_endx:
48 "unsupported rnglists encoding DW_RLE_startx_endx at " 51 case dwarf::DW_RLE_startx_length: {
52 uint32_t PreviousOffset = *OffsetPtr - 1;
58 "read past end of table when reading " 59 "DW_RLE_startx_length encoding at offset 0x%" PRIx32,
63 case dwarf::DW_RLE_offset_pair: {
64 uint32_t PreviousOffset = *OffsetPtr - 1;
69 "read past end of table when reading " 70 "DW_RLE_offset_pair encoding at offset 0x%" PRIx32,
74 case dwarf::DW_RLE_base_address: {
77 "insufficient space remaining in table for " 78 "DW_RLE_base_address encoding at offset 0x%" PRIx32,
83 case dwarf::DW_RLE_start_end: {
86 "insufficient space remaining in table for " 87 "DW_RLE_start_end encoding " 88 "at offset 0x%" PRIx32,
94 case dwarf::DW_RLE_start_length: {
95 uint32_t PreviousOffset = *OffsetPtr - 1;
100 "read past end of table when reading " 101 "DW_RLE_start_length encoding at offset 0x%" PRIx32,
107 "unknown rnglists encoding 0x%" PRIx32
108 " at offset 0x%" PRIx32,
109 uint32_t(Encoding), *OffsetPtr - 1);
121 if (RLE.EntryKind == dwarf::DW_RLE_end_of_list)
123 if (RLE.EntryKind == dwarf::DW_RLE_base_addressx) {
126 BaseAddr = {RLE.Value0, -1ULL};
129 if (RLE.EntryKind == dwarf::DW_RLE_base_address) {
130 BaseAddr = {RLE.Value0, RLE.SectionIndex};
139 switch (RLE.EntryKind) {
140 case dwarf::DW_RLE_offset_pair:
141 E.
LowPC = RLE.Value0;
148 case dwarf::DW_RLE_start_end:
149 E.
LowPC = RLE.Value0;
152 case dwarf::DW_RLE_start_length:
153 E.
LowPC = RLE.Value0;
156 case dwarf::DW_RLE_startx_length: {
161 E.
LowPC = Start->Address;
176 raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
179 LookupPooledAddress)
const {
185 .
dump(OS, AddrSize, DumpOpts);
195 assert(!EncodingString.empty() &&
"Unknown range entry encoding");
196 OS <<
format(
" [%s%*c", EncodingString.data(),
197 MaxEncodingStringLength - EncodingString.size() + 1,
']');
198 if (
EntryKind != dwarf::DW_RLE_end_of_list)
203 case dwarf::DW_RLE_end_of_list:
204 OS << (DumpOpts.
Verbose ?
"" :
"<End of list>");
207 case dwarf::DW_RLE_base_addressx: {
208 if (
auto SA = LookupPooledAddress(
Value0))
209 CurrentBase = SA->Address;
214 OS <<
format(
" 0x%*.*" PRIx64, AddrSize * 2, AddrSize * 2,
Value0);
217 case dwarf::DW_RLE_base_address:
222 OS <<
format(
" 0x%*.*" PRIx64, AddrSize * 2, AddrSize * 2,
Value0);
224 case dwarf::DW_RLE_start_length:
225 PrintRawEntry(OS, *
this, AddrSize, DumpOpts);
228 case dwarf::DW_RLE_offset_pair:
229 PrintRawEntry(OS, *
this, AddrSize, DumpOpts);
231 .
dump(OS, AddrSize, DumpOpts);
233 case dwarf::DW_RLE_start_end:
236 case dwarf::DW_RLE_startx_length: {
237 PrintRawEntry(OS, *
this, AddrSize, DumpOpts);
239 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.
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.
void dump(raw_ostream &OS, uint32_t AddressSize, DIDumpOptions DumpOpts={}) const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
StringRef RangeListEncodingString(unsigned Encoding)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static ErrorSuccess success()
Create a success value.
uint32_t Offset
The offset at which the entry is located in the section.
This file contains constants used for implementing Dwarf debug support.
Optional< SectionedAddress > getAddrOffsetSectionItem(uint32_t Index) const
void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength, uint64_t &CurrentBase, DIDumpOptions DumpOpts, llvm::function_ref< Optional< SectionedAddress >(uint32_t)> LookupPooledAddress) const
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.
DWARFAddressRangesVector getAbsoluteRanges(llvm::Optional< SectionedAddress > BaseAddr, DWARFUnit &U) const
Build a DWARFAddressRangesVector from a rangelist.
This class implements an extremely fast bulk output stream that can only output to a stream...
A class representing a single range list entry.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Error extract(DWARFDataExtractor Data, uint32_t End, uint32_t *OffsetPtr)