|
LLVM 23.0.0git
|
GsymReaderV2 reads GSYM V2 data from a buffer. More...
#include "llvm/DebugInfo/GSYM/GsymReaderV2.h"
Public Member Functions | |
| GsymReaderV2 (GsymReaderV2 &&RHS)=default | |
| ~GsymReaderV2 () override=default | |
| uint16_t | getVersion () const override |
| Get the GSYM version for this reader. | |
| uint64_t | getBaseAddress () const override |
| Get the base address of this GSYM file. | |
| uint64_t | getNumAddresses () const override |
| Get the number of addresses in this GSYM file. | |
| uint8_t | getAddressOffsetSize () const override |
| Get the address offset byte size for this GSYM file. | |
| uint8_t | getAddressInfoOffsetSize () const override |
| Get the address info offset byte size for this GSYM file. | |
| uint8_t | getStringOffsetSize () const override |
| Get the string offset byte size for this GSYM file. | |
| LLVM_ABI void | dump (raw_ostream &OS) override |
| Dump the entire Gsym data contained in this object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const FunctionInfo &FI, uint32_t Indent=0) |
| Dump a FunctionInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const MergedFunctionsInfo &MFI) |
| Dump a MergedFunctionsInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const CallSiteInfo &CSI) |
| Dump a CallSiteInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const CallSiteInfoCollection &CSIC, uint32_t Indent=0) |
| Dump a CallSiteInfoCollection object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const LineTable <, uint32_t Indent=0) |
| Dump a LineTable object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const InlineInfo &II, uint32_t Indent=0) |
| Dump a InlineInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, std::optional< FileEntry > FE) |
| Dump a FileEntry object. | |
| Public Member Functions inherited from llvm::gsym::GsymReader | |
| LLVM_ABI | GsymReader (GsymReader &&RHS)=default |
| virtual | ~GsymReader ()=default |
| bool | isLittleEndian () const |
| LLVM_ABI llvm::Expected< FunctionInfo > | getFunctionInfo (uint64_t Addr) const |
| Get the full function info for an address. | |
| LLVM_ABI llvm::Expected< FunctionInfo > | getFunctionInfoAtIndex (uint64_t AddrIdx) const |
| Get the full function info given an address index. | |
| LLVM_ABI llvm::Expected< LookupResult > | lookup (uint64_t Addr, std::optional< GsymDataExtractor > *MergedFuncsData=nullptr) const |
| Lookup an address in the a GSYM. | |
| LLVM_ABI llvm::Expected< std::vector< LookupResult > > | lookupAll (uint64_t Addr) const |
| Lookup all merged functions for a given address. | |
| StringRef | getString (gsym_strp_t Offset) const |
| Get a string from the string table. | |
| std::optional< FileEntry > | getFile (uint32_t Index) const |
| Get the a file entry for the suppplied file index. | |
| LLVM_ABI void | dump (raw_ostream &OS, const FunctionInfo &FI, uint32_t Indent=0) |
| Dump a FunctionInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const MergedFunctionsInfo &MFI) |
| Dump a MergedFunctionsInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const CallSiteInfo &CSI) |
| Dump a CallSiteInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const CallSiteInfoCollection &CSIC, uint32_t Indent=0) |
| Dump a CallSiteInfoCollection object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const LineTable <, uint32_t Indent=0) |
| Dump a LineTable object. | |
| LLVM_ABI void | dump (raw_ostream &OS, const InlineInfo &II, uint32_t Indent=0) |
| Dump a InlineInfo object. | |
| LLVM_ABI void | dump (raw_ostream &OS, std::optional< FileEntry > FE) |
| Dump a FileEntry object. | |
| LLVM_ABI std::optional< uint64_t > | getAddress (size_t Index) const |
| Gets an address from the address table. | |
Protected Member Functions | |
| GsymReaderV2 (std::unique_ptr< MemoryBuffer > Buffer, llvm::endianness Endian) | |
| llvm::Error | parseHeaderAndGlobalDataEntries () override |
| For V2 file layout, see HeaderV2.h. | |
| Protected Member Functions inherited from llvm::gsym::GsymReader | |
| GsymReader (std::unique_ptr< MemoryBuffer > Buffer, llvm::endianness Endian) | |
| LLVM_ABI std::optional< GlobalData > | getGlobalData (GlobalInfoType Type) const |
| Get the GlobalData entry for a section type. | |
| LLVM_ABI llvm::Expected< StringRef > | getRequiredGlobalDataBytes (GlobalInfoType Type) const |
| Get the raw bytes for a required GlobalData section as a StringRef. | |
| LLVM_ABI std::optional< StringRef > | getOptionalGlobalDataBytes (GlobalInfoType Type) const |
| Get the raw bytes for an optional GlobalData section as a StringRef. | |
| LLVM_ABI llvm::Error | parse () |
| Parse the GSYM data from the memory buffer. | |
| template<class HeaderT> | |
| llvm::Error | parseHeader (const HeaderT *&OutHdr, std::unique_ptr< HeaderT > &OutSwappedHdr) |
| Parse and validate the header from the beginning of the memory buffer. | |
| llvm::Error | parseGlobalDataEntries (uint64_t Offset) |
Parse GlobalData entries starting at Offset into GlobalDataSections. | |
| llvm::Error | parseAddrOffsets (StringRef Bytes) |
| Parse address offsets section bytes into AddrOffsets. | |
| llvm::Error | setAddrInfoOffsetsData (StringRef Bytes) |
| Set address info offsets section bytes into AddrInfoOffsetsData. | |
| llvm::Error | setStringTableData (StringRef Bytes) |
| Set string table section bytes into StrTab. | |
| llvm::Error | setFileTableData (StringRef Bytes) |
| Set file table section bytes into FileEntryData. | |
| template<class T> | |
| ArrayRef< T > | getAddrOffsets () const |
| Get an appropriate address info offsets array. | |
| template<class T> | |
| std::optional< uint64_t > | addressForIndex (size_t Index) const |
| Get an appropriate address from the address table. | |
| template<class T> | |
| std::optional< uint64_t > | getAddressOffsetIndex (const uint64_t AddrOffset) const |
| Lookup an address offset in the AddrOffsets table. | |
| LLVM_ABI Expected< uint64_t > | getAddressIndex (const uint64_t Addr) const |
| Given an address, find the address index. | |
| LLVM_ABI std::optional< uint64_t > | getAddressInfoOffset (size_t Index) const |
| Given an address index, get the offset for the FunctionInfo. | |
| LLVM_ABI llvm::Expected< GsymDataExtractor > | getFunctionInfoDataForAddress (uint64_t Addr, uint64_t &FuncStartAddr) const |
| Given an address, find the correct function info data and function address. | |
| LLVM_ABI llvm::Expected< GsymDataExtractor > | getFunctionInfoDataAtIndex (uint64_t AddrIdx, uint64_t &FuncStartAddr) const |
| Get the function data and address given an address index. | |
Friends | |
| class | GsymReader |
Additional Inherited Members | |
| Static Public Member Functions inherited from llvm::gsym::GsymReader | |
| static LLVM_ABI llvm::Expected< std::unique_ptr< GsymReader > > | openFile (StringRef Path) |
| Construct a GsymReader from a file on disk. | |
| static LLVM_ABI llvm::Expected< std::unique_ptr< GsymReader > > | copyBuffer (StringRef Bytes) |
| Construct a GsymReader from a buffer. | |
| Static Protected Member Functions inherited from llvm::gsym::GsymReader | |
| static LLVM_ABI llvm::Expected< std::unique_ptr< GsymReader > > | create (std::unique_ptr< MemoryBuffer > &MemBuffer) |
| Create a GSYM from a memory buffer. | |
| Protected Attributes inherited from llvm::gsym::GsymReader | |
| std::unique_ptr< MemoryBuffer > | MemBuffer |
| llvm::endianness | Endian |
| std::map< GlobalInfoType, GlobalData > | GlobalDataSections |
| Parsed GlobalData entries, keyed by type. | |
| ArrayRef< uint8_t > | AddrOffsets |
| std::vector< uint8_t > | SwappedAddrOffsets |
| GsymDataExtractor | AddrInfoOffsetsData |
| GsymDataExtractor | FileEntryData |
| StringTable | StrTab |
GsymReaderV2 reads GSYM V2 data from a buffer.
Definition at line 21 of file GsymReaderV2.h.
|
protected |
Definition at line 22 of file GsymReaderV2.cpp.
References llvm::gsym::GsymReader::Endian, GsymReader, and llvm::move().
Referenced by GsymReaderV2().
|
default |
References GsymReaderV2(), and RHS.
|
overridedefault |
|
overridevirtual |
Dump the entire Gsym data contained in this object.
| OS | The output stream to dump to. |
Re-parse the GlobalData entries to ensure we show the GlobalData in the exact order it appears in the GSYM data.
Implements llvm::gsym::GsymReader.
Definition at line 33 of file GsymReaderV2.cpp.
References llvm::gsym::GsymReader::AddrInfoOffsetsData, assert(), llvm::Data, llvm::StringRef::data(), llvm::gsym::GlobalData::decode(), llvm::gsym::dump(), dump(), llvm::gsym::EndOfList, llvm::gsym::GlobalData::FileOffset, llvm::gsym::GlobalData::FileSize, llvm::format(), llvm::format_hex_no_prefix(), llvm::gsym::GsymReader::getAddress(), llvm::gsym::GsymReader::getAddressInfoOffset(), getAddressInfoOffsetSize(), getAddressOffsetSize(), llvm::gsym::HeaderV2::getEncodedSize(), llvm::gsym::GsymReader::getFile(), llvm::gsym::GsymReader::getFunctionInfoAtIndex(), llvm::gsym::getNameForGlobalInfoType(), getNumAddresses(), llvm::gsym::GsymReader::getOptionalGlobalDataBytes(), HEX32, HEX64, I, llvm::gsym::GsymReader::isLittleEndian(), llvm::logAllUnhandledErrors(), llvm::gsym::GsymReader::MemBuffer, llvm::Offset, llvm::StringRef::size(), llvm::gsym::GsymReader::StrTab, llvm::gsym::GlobalData::Type, and llvm::gsym::UUID.
Referenced by dump().
| void GsymReader::dump | ( | raw_ostream & | OS, |
| const CallSiteInfo & | CSI ) |
Dump a CallSiteInfo object.
This function will output the details of a CallSiteInfo object in a human-readable format.
| OS | The output stream to dump to. |
| CSI | The CallSiteInfo object to dump. |
Definition at line 233 of file GsymReader.cpp.
| void GsymReader::dump | ( | raw_ostream & | OS, |
| const CallSiteInfoCollection & | CSIC, | ||
| uint32_t | Indent = 0 ) |
Dump a CallSiteInfoCollection object.
This function will iterate over a collection of CallSiteInfo objects and dump each one.
| OS | The output stream to dump to. |
| CSIC | The CallSiteInfoCollection object to dump. |
| Indent | The indentation as number of spaces. Used when dumping as an item from within MergedFunctionsInfo. |
Definition at line 246 of file GsymReader.cpp.
| void GsymReader::dump | ( | raw_ostream & | OS, |
| const FunctionInfo & | FI, | ||
| uint32_t | Indent = 0 ) |
Dump a FunctionInfo object.
This function will convert any string table indexes and file indexes into human readable format.
| OS | The output stream to dump to. |
| FI | The object to dump. |
| Indent | The indentation as number of spaces. Used when dumping as an item within MergedFunctionsInfo. |
Definition at line 212 of file GsymReader.cpp.
| void GsymReader::dump | ( | raw_ostream & | OS, |
| const InlineInfo & | II, | ||
| uint32_t | Indent = 0 ) |
Dump a InlineInfo object.
This function will convert any string table indexes and file indexes into human readable format.
| OS | The output stream to dump to. |
| II | The object to dump. |
| Indent | The indentation as number of spaces. Used for recurive dumping. |
Definition at line 274 of file GsymReader.cpp.
| void GsymReader::dump | ( | raw_ostream & | OS, |
| const LineTable & | LT, | ||
| uint32_t | Indent = 0 ) |
Dump a LineTable object.
This function will convert any string table indexes and file indexes into human readable format.
| OS | The output stream to dump to. |
| LT | The object to dump. |
| Indent | The indentation as number of spaces. Used when dumping as an item from within MergedFunctionsInfo. |
Definition at line 261 of file GsymReader.cpp.
| void GsymReader::dump | ( | raw_ostream & | OS, |
| const MergedFunctionsInfo & | MFI ) |
Dump a MergedFunctionsInfo object.
This function will dump a MergedFunctionsInfo object - basically by dumping the contained FunctionInfo objects with indentation.
| OS | The output stream to dump to. |
| MFI | The object to dump. |
Definition at line 223 of file GsymReader.cpp.
| void GsymReader::dump | ( | raw_ostream & | OS, |
| std::optional< FileEntry > | FE ) |
Dump a FileEntry object.
This function will convert any string table indexes into human readable format.
| OS | The output stream to dump to. |
| FE | The object to dump. |
Definition at line 285 of file GsymReader.cpp.
|
inlineoverridevirtual |
Get the address info offset byte size for this GSYM file.
Implements llvm::gsym::GsymReader.
Definition at line 39 of file GsymReaderV2.h.
References llvm::gsym::HeaderV2::getAddressInfoOffsetSize().
Referenced by dump().
|
inlineoverridevirtual |
Get the address offset byte size for this GSYM file.
Implements llvm::gsym::GsymReader.
Definition at line 38 of file GsymReaderV2.h.
Referenced by dump().
|
inlineoverridevirtual |
Get the base address of this GSYM file.
Implements llvm::gsym::GsymReader.
Definition at line 36 of file GsymReaderV2.h.
|
inlineoverridevirtual |
Get the number of addresses in this GSYM file.
Implements llvm::gsym::GsymReader.
Definition at line 37 of file GsymReaderV2.h.
Referenced by dump().
|
inlineoverridevirtual |
Get the string offset byte size for this GSYM file.
Implements llvm::gsym::GsymReader.
Definition at line 42 of file GsymReaderV2.h.
References llvm::gsym::HeaderV2::getStringOffsetSize().
|
inlineoverridevirtual |
Get the GSYM version for this reader.
Implements llvm::gsym::GsymReader.
Definition at line 35 of file GsymReaderV2.h.
References llvm::gsym::HeaderV2::getVersion().
|
overrideprotectedvirtual |
For V2 file layout, see HeaderV2.h.
Implements llvm::gsym::GsymReader.
Definition at line 27 of file GsymReaderV2.cpp.
References llvm::gsym::HeaderV2::getEncodedSize(), llvm::gsym::GsymReader::parseGlobalDataEntries(), and llvm::gsym::GsymReader::parseHeader().
|
friend |
Definition at line 22 of file GsymReaderV2.h.
References llvm::gsym::GsymReader::Endian, and GsymReader.
Referenced by GsymReader, and GsymReaderV2().