25 for (
auto Range : II.
Ranges) {
33 <<
", CallLine = " << II.
CallFile <<
'\n';
34 for (
const auto &Child : II.
Children)
40 std::vector<const InlineInfo *> &InlineStack) {
46 InlineStack.insert(InlineStack.begin(), &II);
47 for (
const auto &Child : II.
Children) {
51 return !InlineStack.empty();
81 bool HasChildren = Data.
getU8(&Offset) != 0;
86 while (
skip(Data, Offset,
false ))
118 skip(Data, Offset,
true );
124 bool HasChildren = Data.
getU8(&Offset) != 0;
131 const auto ChildBaseAddr = Inline.
Ranges[0].Start;
134 Done =
lookup(GR, Data, Offset, ChildBaseAddr, Addr, SrcLocs, Err);
140 "failed to extract file[%" PRIu32
"]",
151 SrcLocs.push_back(SrcLoc);
156 uint64_t BaseAddr, uint64_t Addr,
161 ::lookup(GR, Data, Offset, BaseAddr, Addr, SrcLocs, Err);
180 "0x%8.8" PRIx64
": missing InlineInfo address ranges data", Offset);
186 "0x%8.8" PRIx64
": missing InlineInfo uint8_t indicating children",
188 bool HasChildren = Data.
getU8(&Offset) != 0;
191 "0x%8.8" PRIx64
": missing InlineInfo uint32_t for name", Offset);
195 "0x%8.8" PRIx64
": missing ULEB128 for InlineInfo call file", Offset);
199 "0x%8.8" PRIx64
": missing ULEB128 for InlineInfo call line", Offset);
204 const auto ChildBaseAddr = Inline.
Ranges[0].Start;
210 if (Child.
get().Ranges.empty())
212 Inline.
Children.emplace_back(std::move(*Child));
230 "attempted to encode invalid InlineInfo object");
232 bool HasChildren = !
Children.empty();
241 const uint64_t ChildBaseAddr =
Ranges[0].Start;
242 for (
const auto &Child :
Children) {
245 for (
const auto &ChildRange: Child.Ranges) {
248 "child range not contained in parent");
GsymReader is used to read GSYM data from a file or buffer.
static uint64_t skip(DataExtractor &Data, uint64_t &Offset)
Skip an address range object in the specified data a the specified offset.
static llvm::Error lookup(const GsymReader &GR, DataExtractor &Data, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs)
Lookup a single address within the inline info data.
StringRef Base
Line entry source file basename.
This class represents lattice values for constants.
StringRef Dir
Line entry source file directory path.
void writeU8(uint8_t Value)
Write a single uint8_t value into the stream at the current file position.
void writeULEB(uint64_t Value)
Write the value into the stream encoded using unsigned LEB128 at the current file position...
Inline information stores the name of the inline function along with an array of address ranges...
static bool skip(DataExtractor &Data, uint64_t &Offset, bool SkippedRanges)
Skip an InlineInfo object in the specified data at the specified offset.
bool contains(uint64_t Addr) const
uint32_t Line
Source file line number.
uint32_t Dir
Offsets in the string table.
Error takeError()
Take ownership of the stored error.
void writeU32(uint32_t Value)
Write a single uint32_t value into the stream at the current file position.
uint32_t Name
String table offset in the string 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.
std::vector< InlineInfo > Children
llvm::Optional< InlineArray > getInlineStack(uint64_t Addr) const
Lookup an address in the InlineInfo object.
A simplified binary data writer class that doesn't require targets, target definitions, architectures, or require any other optional compile time libraries to be enabled via the build process.
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an InlineInfo object from a binary data stream.
std::vector< const InlineInfo * > InlineArray
uint32_t CallFile
1 based file index in the file table.
StringRef Name
Function or symbol name.
LLVM_NODISCARD char back() const
back - Get the last character in the string.
static ErrorSuccess success()
Create a success value.
std::vector< SourceLocation > SourceLocations
reference get()
Returns a reference to the stored T value.
void encode(FileWriter &O, uint64_t BaseAddr) const
uint32_t CallLine
Source line number.
static bool getInlineStackHelper(const InlineInfo &II, uint64_t Addr, std::vector< const InlineInfo *> &InlineStack)
void decode(DataExtractor &Data, uint64_t BaseAddr, uint64_t &Offset)
Address ranges are decoded and encoded to be relative to a base address.
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr)
Decode an InlineInfo in Data at the specified offset.
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
llvm::Error encode(FileWriter &O, uint64_t BaseAddr) const
Encode this InlineInfo object into FileWriter stream.
raw_ostream & operator<<(raw_ostream &OS, const FunctionInfo &R)
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.