9#ifndef LLVM_DEBUGINFO_GSYM_GSYMCREATOR_H
10#define LLVM_DEBUGINFO_GSYM_GSYMCREATOR_H
135 mutable std::mutex
Mutex;
136 std::vector<FunctionInfo> Funcs;
142 std::vector<llvm::gsym::FileEntry> Files;
143 std::vector<uint8_t>
UUID;
144 std::optional<AddressRanges> ValidTextRanges;
145 std::optional<uint64_t> BaseAddress;
146 bool IsSegment =
false;
147 bool Finalized =
false;
155 std::optional<uint64_t> getFirstFunctionAddress()
const;
161 std::optional<uint64_t> getLastFunctionAddress()
const;
168 std::optional<uint64_t> getBaseAddress()
const;
178 uint8_t getAddressOffsetSize()
const;
188 uint64_t getMaxAddressOffset()
const;
203 uint64_t calculateHeaderAndTableSize()
const;
289 void setIsSegment() {
311 std::optional<uint64_t> SegmentSize = std::nullopt)
const;
384 std::function<
bool(
const FunctionInfo &)>
const &Callback)
const;
392 ValidTextRanges = TextRanges;
397 return ValidTextRanges;
StringSet - A set-like wrapper for the StringMap.
std::pair< llvm::MachO::Target, std::string > UUID
The AddressRanges class helps normalize address range collections.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
StringSet - A wrapper for StringMap that provides set-like functionality.
Utility for building string tables with deduplicated suffixes.
A simplified binary data writer class that doesn't require targets, target definitions,...
GsymCreator is used to emit GSYM data to a stand alone file or section within a file.
void addFunctionInfo(FunctionInfo &&FI)
Add a function info to this GSYM creator.
uint32_t insertString(StringRef S, bool Copy=true)
Insert a string into the GSYM string table.
void setBaseAddress(uint64_t Addr)
Set the base address to use for the GSYM file.
const std::optional< AddressRanges > GetValidTextRanges() const
Get the valid text ranges.
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.
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::Error encode(FileWriter &O) const
Encode a GSYM into the file writer stream at the current position.
bool isQuiet() const
Whether the transformation should be quiet, i.e. not output warnings.
void setUUID(llvm::ArrayRef< uint8_t > UUIDBytes)
Set the UUID value.
void SetValidTextRanges(AddressRanges &TextRanges)
Set valid .text address ranges that all functions must be contained in.
uint32_t insertFile(StringRef Path, sys::path::Style Style=sys::path::Style::native)
Insert a file into this GSYM creator.
size_t getNumFunctionInfos() const
Get the current number of FunctionInfo objects contained in this object.
bool IsValidTextAddress(uint64_t Addr) const
Check if an address is a valid code address.
void forEachFunctionInfo(std::function< bool(FunctionInfo &)> const &Callback)
Thread safe iteration over all function infos.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
Files in GSYM are contained in FileEntry structs where we split the directory and basename into two d...
Function information in GSYM files encodes information for one contiguous address range.
Inline information stores the name of the inline function along with an array of address ranges.