33 const uint64_t NumAddrs = Hdr->NumAddresses;
34 const uint8_t AddrOffSize = Hdr->AddrOffSize;
38 uint64_t AddrOffsetsSize = NumAddrs * AddrOffSize;
48 Offset += AddrInfoOffsetsSize;
55 4 +
static_cast<uint64_t>(NumFiles) *
65 const uint64_t FIOffset = Hdr->StrtabOffset + Hdr->StrtabSize;
74 OS <<
"Address Table:\n";
95 OS <<
"====== =============================== \n";
100 OS << HEX8(getAddrOffsets<uint8_t>()[
I]);
103 OS << HEX16(getAddrOffsets<uint16_t>()[
I]);
106 OS << HEX32(getAddrOffsets<uint32_t>()[
I]);
109 OS << HEX32(getAddrOffsets<uint64_t>()[
I]);
116 OS <<
"\nAddress Info Offsets:\n";
117 OS <<
"INDEX Offset\n";
118 OS <<
"====== ==========\n";
122 OS <<
"INDEX DIRECTORY BASENAME PATH\n";
123 OS <<
"====== ========== ========== ==============================\n";
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
uint8_t getAddressOffsetSize() const override
Get the address offset byte size for this GSYM file.
llvm::Error parseHeaderAndGlobalDataEntries() override
Parse the version-specific header and populate GlobalDataSections.
uint64_t getNumAddresses() const override
Get the number of addresses in this GSYM file.
LLVM_ABI void dump(raw_ostream &OS) override
Dump the entire Gsym data contained in this object.
GsymReaderV1(std::unique_ptr< MemoryBuffer > Buffer, llvm::endianness Endian)
std::optional< FileEntry > getFile(uint32_t Index) const
Get the a file entry for the suppplied file index.
bool isLittleEndian() const
llvm::Error parseHeader(const HeaderT *&OutHdr, std::unique_ptr< HeaderT > &OutSwappedHdr)
Parse and validate the header from the beginning of the memory buffer.
LLVM_ABI std::optional< uint64_t > getAddress(size_t Index) const
Gets an address from the address table.
LLVM_ABI std::optional< uint64_t > getAddressInfoOffset(size_t Index) const
Given an address index, get the offset for the FunctionInfo.
std::map< GlobalInfoType, GlobalData > GlobalDataSections
Parsed GlobalData entries, keyed by type.
std::unique_ptr< MemoryBuffer > MemBuffer
LLVM_ABI llvm::Expected< FunctionInfo > getFunctionInfoAtIndex(uint64_t AddrIdx) const
Get the full function info given an address index.
This class implements an extremely fast bulk output stream that can only output to a stream.
void dump(raw_ostream &OS, const StringTable &S, uint8_t StringOffsetSize)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner={})
Log all errors (if any) in E to OS.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
static constexpr uint64_t getEncodedSize(uint8_t StringOffsetSize)
Returns the on-disk encoded size of a FileEntry for the given string offset size.