19 uint64_t *OffsetPtr) {
20 HeaderOffset = *OffsetPtr;
24 "section is not large enough to contain a " 25 "%s table length at offset 0x%" PRIx64,
28 uint8_t OffsetByteSize = 4;
33 HeaderData.Length = Data.
getU64(OffsetPtr);
36 "%s table at offset 0x%" PRIx64
37 " has unsupported reserved unit length of value 0x%8.8" PRIx64,
38 SectionName.data(), HeaderOffset, HeaderData.Length);
45 "%s table at offset 0x%" PRIx64
46 " has too small length (0x%" PRIx64
47 ") to contain a complete header",
49 uint64_t End = HeaderOffset + FullLength;
52 "section is not large enough to contain a %s table " 53 "of length 0x%" PRIx64
" at offset 0x%" PRIx64,
56 HeaderData.Version = Data.
getU16(OffsetPtr);
57 HeaderData.AddrSize = Data.
getU8(OffsetPtr);
58 HeaderData.SegSize = Data.
getU8(OffsetPtr);
59 HeaderData.OffsetEntryCount = Data.
getU32(OffsetPtr);
62 if (HeaderData.Version != 5)
64 "unrecognised %s table version %" PRIu16
65 " in table at offset 0x%" PRIx64,
66 SectionName.data(), HeaderData.Version, HeaderOffset);
67 if (HeaderData.AddrSize != 4 && HeaderData.AddrSize != 8)
69 "%s table at offset 0x%" PRIx64
70 " has unsupported address size %" PRIu8,
71 SectionName.data(), HeaderOffset, HeaderData.AddrSize);
72 if (HeaderData.SegSize != 0)
74 "%s table at offset 0x%" PRIx64
75 " has unsupported segment selector size %" PRIu8,
76 SectionName.data(), HeaderOffset, HeaderData.SegSize);
78 HeaderData.OffsetEntryCount * OffsetByteSize)
80 "%s table at offset 0x%" PRIx64
" has more offset entries (%" PRIu32
81 ") than there is space for",
82 SectionName.data(), HeaderOffset, HeaderData.OffsetEntryCount);
84 for (
uint32_t I = 0;
I < HeaderData.OffsetEntryCount; ++
I)
91 OS <<
format(
"0x%8.8" PRIx64
": ", HeaderOffset);
93 "%s list header: length = 0x%8.8" PRIx64
", version = 0x%4.4" PRIx16
", " 94 "addr_size = 0x%2.2" PRIx8
", seg_size = 0x%2.2" PRIx8
95 ", offset_entry_count = " 97 ListTypeString.
data(), HeaderData.Length, HeaderData.Version,
98 HeaderData.AddrSize, HeaderData.SegSize, HeaderData.OffsetEntryCount);
100 if (HeaderData.OffsetEntryCount > 0) {
102 for (
const auto &Off : Offsets) {
103 OS <<
format(
"\n0x%8.8" PRIx64, Off);
105 OS <<
format(
" => 0x%8.8" PRIx64,
113 if (HeaderData.Length == 0)
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.
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
Container for dump options that control which debug information will be dumped.
static ErrorSuccess success()
Create a success value.
This file contains constants used for implementing Dwarf debug support.
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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...
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.