LLVM 23.0.0git
llvm::gsym::GsymCreatorV2 Class Reference

GsymCreatorV2 emits GSYM V2 data with a GlobalData-based section layout. More...

#include "llvm/DebugInfo/GSYM/GsymCreatorV2.h"

Inheritance diagram for llvm::gsym::GsymCreatorV2:
[legend]

Public Member Functions

 GsymCreatorV2 (bool Quiet=false)
uint8_t getStringOffsetSize () const override
 Get the size in bytes needed for encoding string offsets.
LLVM_ABI llvm::Error encode (FileWriter &O) const override
 For V2 file layout, see HeaderV2.h.
Public Member Functions inherited from llvm::gsym::GsymCreator
LLVM_ABI GsymCreator (bool Quiet=false)
virtual ~GsymCreator ()=default
LLVM_ABI llvm::Error save (StringRef Path, llvm::endianness ByteOrder, std::optional< uint64_t > SegmentSize=std::nullopt) const
 Save a GSYM file to a stand alone file.
LLVM_ABI gsym_strp_t insertString (StringRef S, bool Copy=true)
 Insert a string into the GSYM string table.
LLVM_ABI StringRef getString (gsym_strp_t Offset)
 Retrieve a string from the GSYM string table given its offset.
LLVM_ABI uint32_t insertFile (StringRef Path, sys::path::Style Style=sys::path::Style::native)
 Insert a file into this GSYM creator.
LLVM_ABI void addFunctionInfo (FunctionInfo &&FI)
 Add a function info to this GSYM creator.
LLVM_ABI llvm::Error loadCallSitesFromYAML (StringRef YAMLFile)
 Load call site information from a YAML file.
LLVM_ABI void prepareMergedFunctions (OutputAggregator &Out)
 Organize merged FunctionInfo's.
LLVM_ABI llvm::Error finalize (OutputAggregator &OS)
 Finalize the data in the GSYM creator prior to saving the data out.
void setUUID (llvm::ArrayRef< uint8_t > UUIDBytes)
 Set the UUID value.
LLVM_ABI void forEachFunctionInfo (std::function< bool(FunctionInfo &)> const &Callback)
 Thread safe iteration over all function infos.
LLVM_ABI void forEachFunctionInfo (std::function< bool(const FunctionInfo &)> const &Callback) const
 Thread safe const iteration over all function infos.
LLVM_ABI size_t getNumFunctionInfos () const
 Get the current number of FunctionInfo objects contained in this object.
void SetValidTextRanges (AddressRanges &TextRanges)
 Set valid .text address ranges that all functions must be contained in.
const std::optional< AddressRangesGetValidTextRanges () const
 Get the valid text ranges.
LLVM_ABI bool IsValidTextAddress (uint64_t Addr) const
 Check if an address is a valid code address.
void setBaseAddress (uint64_t Addr)
 Set the base address to use for the GSYM file.
bool isQuiet () const
 Whether the transformation should be quiet, i.e. not output warnings.
LLVM_ABI llvm::Expected< std::unique_ptr< GsymCreator > > createSegment (uint64_t SegmentSize, size_t &FuncIdx) const
 Create a segmented GSYM creator starting with function info index FuncIdx.

Additional Inherited Members

Protected Member Functions inherited from llvm::gsym::GsymCreator
std::optional< uint64_tgetFirstFunctionAddress () const
 Get the first function start address.
std::optional< uint64_tgetLastFunctionAddress () const
 Get the last function address.
std::optional< uint64_tgetBaseAddress () const
 Get the base address to use for this GSYM file.
uint8_t getAddressOffsetSize () const
 Get the size of an address offset in the address offset table.
uint64_t getMaxAddressOffset () const
 Get the maximum address offset for the current address offset size.
uint64_t copyFunctionInfo (const GsymCreator &SrcGC, size_t FuncInfoIdx)
 Copy a FunctionInfo from the SrcGC GSYM creator into this creator.
gsym_strp_t copyString (const GsymCreator &SrcGC, gsym_strp_t StrOff)
 Copy a string from SrcGC into this object.
uint32_t copyFile (const GsymCreator &SrcGC, uint32_t FileIdx)
 Copy a file from SrcGC into this object.
uint32_t insertFileEntry (FileEntry FE)
 Inserts a FileEntry into the file table.
void fixupInlineInfo (const GsymCreator &SrcGC, InlineInfo &II)
 Fixup any string and file references by updating any file indexes and strings offsets in the InlineInfo parameter.
llvm::Error saveSegments (StringRef Path, llvm::endianness ByteOrder, uint64_t SegmentSize) const
 Save this GSYM file into segments that are roughly SegmentSize in size.
void setIsSegment ()
 Let this creator know that this is a segment of another GsymCreator.
llvm::Error validateForEncoding (std::optional< uint64_t > &BaseAddr) const
 Validate that the creator is ready for encoding.
void encodeAddrOffsets (FileWriter &O, uint8_t AddrOffSize, uint64_t BaseAddr) const
 Write the address offsets table to the output stream.
llvm::Error encodeFileTable (FileWriter &O) const
 Write the file table to the output stream.
Protected Attributes inherited from llvm::gsym::GsymCreator
std::mutex Mutex
std::vector< FunctionInfoFuncs
StringTableBuilder StrTab
StringSet StringStorage
DenseMap< llvm::gsym::FileEntry, uint32_tFileEntryToIndex
DenseMap< uint64_t, CachedHashStringRefStringOffsetMap
std::vector< llvm::gsym::FileEntryFiles
std::vector< uint8_tUUID
std::optional< AddressRangesValidTextRanges
std::optional< uint64_tBaseAddress
bool IsSegment = false
bool Finalized = false
bool Quiet

Detailed Description

GsymCreatorV2 emits GSYM V2 data with a GlobalData-based section layout.

Definition at line 19 of file GsymCreatorV2.h.

Constructor & Destructor Documentation

◆ GsymCreatorV2()

llvm::gsym::GsymCreatorV2::GsymCreatorV2 ( bool Quiet = false)
inline

Member Function Documentation

◆ encode()

◆ getStringOffsetSize()

uint8_t llvm::gsym::GsymCreatorV2::getStringOffsetSize ( ) const
inlineoverridevirtual

Get the size in bytes needed for encoding string offsets.

Implements llvm::gsym::GsymCreator.

Definition at line 28 of file GsymCreatorV2.h.

References llvm::gsym::HeaderV2::getStringOffsetSize().

Referenced by encode().


The documentation for this class was generated from the following files: