34 std::memset(&HeaderData, 0,
sizeof(
Header));
35 ArangeDescriptors.clear();
42 ArangeDescriptors.clear();
78 "parsing address ranges table at offset 0x%" PRIx64
88 "the length of address range table at offset "
89 "0x%" PRIx64
" exceeds section size",
93 "address range table at offset 0x%" PRIx64, Offset))
97 "non-zero segment selector size in address range "
98 "table at offset 0x%" PRIx64
" is not supported",
106 if (full_length % tuple_size != 0)
109 "address range table at offset 0x%" PRIx64
110 " has length that is not a multiple of the tuple size",
114 const uint32_t header_size = *offset_ptr - Offset;
116 while (first_tuple_offset < header_size)
117 first_tuple_offset += tuple_size;
120 if (full_length <= first_tuple_offset)
123 "address range table at offset 0x%" PRIx64
124 " has an insufficient length to contain any entries",
127 *offset_ptr = Offset + first_tuple_offset;
131 static_assert(
sizeof(arangeDescriptor.
Address) ==
132 sizeof(arangeDescriptor.
Length),
133 "Different datatypes for addresses and sizes!");
136 uint64_t end_offset = Offset + full_length;
137 while (*offset_ptr < end_offset) {
144 if (arangeDescriptor.
Length == 0 && arangeDescriptor.
Address == 0) {
145 if (*offset_ptr == end_offset)
147 if (WarningHandler) {
150 "address range table at offset 0x%" PRIx64
151 " has a premature terminator entry at offset 0x%" PRIx64,
152 Offset, EntryOffset));
156 ArangeDescriptors.push_back(arangeDescriptor);
160 "address range table at offset 0x%" PRIx64
161 " is not terminated by null entry",
167 OS <<
"Address Range Header: "
168 <<
format(
"length = 0x%0*" PRIx64
", ", OffsetDumpWidth, HeaderData.
Length)
171 <<
format(
"cu_offset = 0x%0*" PRIx64
", ", OffsetDumpWidth,
176 for (
const auto &
Desc : ArangeDescriptors) {
This file contains constants used for implementing Dwarf debug support.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static Error checkAddressSizeSupported(unsigned AddressSize, std::error_code EC, char const *Fmt, const Ts &...Vals)
void dump(raw_ostream &OS) const
Error extract(DWARFDataExtractor data, uint64_t *offset_ptr, function_ref< void(Error)> WarningHandler=nullptr)
Subclass of Error for the sole purpose of identifying the success path in the type system.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
StringRef FormatString(DwarfFormat Format)
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
uint8_t getDwarfOffsetByteSize(DwarfFormat Format)
The size of a reference determined by the DWARF 32/64-bit format.
This is an optimization pass for GlobalISel generic memory operations.
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
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.
const char * toString(DWARFSectionKind Kind)
uint64_t getEndAddress() const
void dump(raw_ostream &OS, uint32_t AddressSize) const
Description of the encoding of one expression Op.