9 #ifndef LLVM_DEBUGINFO_GSYM_GSYMREADER_H 10 #define LLVM_DEBUGINFO_GSYM_GSYMREADER_H 48 GsymReader(std::unique_ptr<MemoryBuffer> Buffer);
51 std::unique_ptr<MemoryBuffer> MemBuffer;
54 const Header *Hdr =
nullptr;
65 std::vector<uint8_t> AddrOffsets;
66 std::vector<uint32_t> AddrInfoOffsets;
67 std::vector<FileEntry> Files;
69 std::unique_ptr<SwappedData> Swap;
145 if (Index < Files.
size())
173 AddrOffsets.
size()/
sizeof(
T));
191 if (Index < AIO.
size())
207 const auto Begin = AIO.
begin();
208 const auto End = AIO.
end();
210 if (Iter == End || AddrOffset < *Iter)
212 return std::distance(Begin, Iter);
225 create(std::unique_ptr<MemoryBuffer> &MemBuffer);
254 #endif // #ifndef LLVM_DEBUGINFO_GSYM_GSYMREADER_H auto lower_bound(R &&Range, T &&Value) -> decltype(adl_begin(Range))
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
GsymReader is used to read GSYM data from a file or buffer.
static llvm::Expected< GsymReader > copyBuffer(StringRef Bytes)
Construct a GsymReader from a buffer.
const Header & getHeader() const
Access the GSYM header.
This class represents lattice values for constants.
uint64_t getAddressOffsetIndex(const uint64_t AddrOffset) const
Lookup an address offset in the AddrOffsets table.
Tagged union holding either a T or a Error.
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.
llvm::Expected< FunctionInfo > getFunctionInfo(uint64_t Addr) const
Get the full function info for an address.
Expected< uint64_t > getAddressIndex(const uint64_t Addr) const
Given an address, find the address index.
Optional< uint64_t > getAddress(size_t Index) const
Gets an address from the address table.
size_t size() const
size - Get the array size.
String tables in GSYM files are required to start with an empty string at offset zero.
static llvm::Expected< GsymReader > openFile(StringRef Path)
Construct a GsymReader from a file on disk.
llvm::Expected< LookupResult > lookup(uint64_t Addr) const
Lookup an address in the a GSYM.
static llvm::Expected< llvm::gsym::GsymReader > create(std::unique_ptr< MemoryBuffer > &MemBuffer)
Create a GSYM from a memory buffer.
Optional< uint64_t > addressForIndex(size_t Index) const
Get an appropriate address from the address table.
Provides ErrorOr<T> smart pointer.
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
ArrayRef< T > getAddrOffsets() const
Get an appropriate address info offsets array.
Optional< uint64_t > getAddressInfoOffset(size_t Index) const
Given an address index, get the offset for the FunctionInfo.