Go to the documentation of this file.
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFLISTTABLE_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFLISTTABLE_H
38 using EntryType = ListEntryType;
39 using ListEntries = std::vector<EntryType>;
116 if (
Index >= HeaderData.OffsetEntryCount)
127 uint64_t Offset = OffsetTableOffset + OffsetByteSize *
Index;
128 auto R =
Data.getUnsigned(&Offset, OffsetByteSize);
150 std::map<uint64_t, DWARFListType> ListMap;
158 : Header(
SectionName, ListTypeString), HeaderString(HeaderString) {}
200 template <
typename DWARFListType>
204 if (
Error E = extractHeaderAndOffsets(
Data, OffsetPtr))
209 while (
Data.isValidOffset(*OffsetPtr)) {
216 ListMap[Off] = CurrentList;
220 "mismatch between expected length of table and length "
221 "of extracted data");
225 template <
typename ListEntryType>
231 if (*OffsetPtr < HeaderOffset || *OffsetPtr >=
Data.size())
233 "invalid %s list offset 0x%" PRIx64,
234 ListTypeString.
data(), *OffsetPtr);
236 while (
Data.isValidOffset(*OffsetPtr)) {
240 Entries.push_back(Entry);
241 if (Entry.isSentinel())
245 "no end of list marker detected at end of %s table "
246 "starting at offset 0x%" PRIx64,
250 template <
typename DWARFListType>
257 OS << HeaderString <<
"\n";
261 size_t MaxEncodingStringLength = 0;
263 for (
const auto &
List : ListMap)
264 for (
const auto &Entry :
List.second.getEntries())
265 MaxEncodingStringLength =
271 for (
const auto &
List : ListMap)
272 for (
const auto &Entry :
List.second.getEntries())
273 Entry.dump(OS, getAddrSize(), MaxEncodingStringLength, CurrentBase,
274 DumpOpts, LookupPooledAddress);
277 template <
typename DWARFListType>
286 List.extract(
Data, Header.
length() ? getHeaderOffset() : 0, &Offset,
294 #endif // LLVM_DEBUGINFO_DWARF_DWARFLISTTABLE_H
This is an optimization pass for GlobalISel generic memory operations.
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_*).
A base class for lists of entries that are extracted from a particular section, such as range lists o...
static ErrorSuccess success()
Create a success value.
uint8_t getAddrSize() const
StringRef RangeListEncodingString(unsigned Encoding)
A base class for DWARF list entries, such as range or location list entries.
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Tagged union holding either a T or a Error.
void dump(DWARFDataExtractor Data, raw_ostream &OS, llvm::function_ref< Optional< object::SectionedAddress >(uint32_t)> LookupPooledAddress, DIDumpOptions DumpOpts={}) const
const ListEntries & getEntries() const
Error extract(DWARFDataExtractor Data, uint64_t HeaderOffset, uint64_t *OffsetPtr, StringRef SectionName, StringRef ListStringName)
static void clear(coro::Shape &Shape)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Error extractHeaderAndOffsets(DWARFDataExtractor Data, uint64_t *OffsetPtr)
Extract the table header and the array of offsets.
This class implements an extremely fast bulk output stream that can only output to a stream.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
An efficient, type-erasing, non-owning reference to a callable.
uint64_t getHeaderOffset() const
A class representing a table of lists as specified in the DWARF v5 standard for location lists and ra...
uint8_t getHeaderSize() const
Return the size of the table header including the length but not including the offsets.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Optional< uint64_t > getOffsetEntry(DataExtractor Data, uint32_t Index) const
Return the contents of the offset entry designated by a given index.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DWARFListTableBase(StringRef SectionName, StringRef HeaderString, StringRef ListTypeString)
uint32_t getOffsetEntryCount() const
dwarf::DwarfFormat getFormat() const
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
Error extract(DWARFDataExtractor Data, uint64_t *OffsetPtr)
Extract an entire table, including all list entries.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
uint64_t SectionIndex
The index of the section this entry belongs to.
Lightweight error class with error context and mandatory checking.
Expected< DWARFListType > findList(DWARFDataExtractor Data, uint64_t Offset) const
Look up a list based on a given offset.
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Container for dump options that control which debug information will be dumped.