Go to the documentation of this file.
9 #ifndef LLVM_DEBUGINFO_GSYM_GSYMREADER_H
10 #define LLVM_DEBUGINFO_GSYM_GSYMREADER_H
45 GsymReader(std::unique_ptr<MemoryBuffer> Buffer);
48 std::unique_ptr<MemoryBuffer> MemBuffer;
51 const Header *Hdr =
nullptr;
62 std::vector<uint8_t> AddrOffsets;
63 std::vector<uint32_t> AddrInfoOffsets;
64 std::vector<FileEntry> Files;
66 std::unique_ptr<SwappedData> Swap;
225 AddrOffsets.
size()/
sizeof(
T));
259 const auto Begin = AIO.
begin();
260 const auto End = AIO.
end();
264 if (Iter == Begin && AddrOffset < *Begin)
266 if (Iter == End || AddrOffset < *Iter)
268 return std::distance(Begin, Iter);
281 create(std::unique_ptr<MemoryBuffer> &MemBuffer);
310 #endif // LLVM_DEBUGINFO_GSYM_GSYMREADER_H
This is an optimization pass for GlobalISel generic memory operations.
Expected< uint64_t > getAddressIndex(const uint64_t Addr) const
Given an address, find the address index.
static llvm::Expected< GsymReader > openFile(StringRef Path)
Construct a GsymReader from a file on disk.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Tagged union holding either a T or a Error.
static llvm::Expected< llvm::gsym::GsymReader > create(std::unique_ptr< MemoryBuffer > &MemBuffer)
Create a GSYM from a memory buffer.
Inline information stores the name of the inline function along with an array of address ranges.
Optional< uint64_t > getAddress(size_t Index) const
Gets an address from the address table.
GsymReader is used to read GSYM data from a file or buffer.
Optional< uint64_t > addressForIndex(size_t Index) const
Get an appropriate address from the address table.
Optional< FileEntry > getFile(uint32_t Index) const
Get the a file entry for the suppplied file index.
StringRef getString(uint32_t Offset) const
Get a string from the string table.
static llvm::Expected< GsymReader > copyBuffer(StringRef Bytes)
Construct a GsymReader from a buffer.
This class implements an extremely fast bulk output stream that can only output to a stream.
const Header & getHeader() const
Access the GSYM header.
LineTable class contains deserialized versions of line tables for each function's address ranges.
Function information in GSYM files encodes information for one contiguous address range.
uint32_t getNumAddresses() const
Get the number of addresses in this Gsym file.
StringRef - Represent a constant reference to a string, i.e.
llvm::Expected< LookupResult > lookup(uint64_t Addr) const
Lookup an address in the a GSYM.
Lightweight error class with error context and mandatory checking.
String tables in GSYM files are required to start with an empty string at offset zero.
Optional< uint64_t > getAddressInfoOffset(size_t Index) const
Given an address index, get the offset for the FunctionInfo.
void dump(raw_ostream &OS)
Dump the entire Gsym data contained in this object.
ArrayRef< T > getAddrOffsets() const
Get an appropriate address info offsets array.
size_t size() const
size - Get the array size.
llvm::Optional< uint64_t > getAddressOffsetIndex(const uint64_t AddrOffset) const
Lookup an address offset in the AddrOffsets table.
llvm::Expected< FunctionInfo > getFunctionInfo(uint64_t Addr) const
Get the full function info for an address.