40 "0x%8.8" PRIx64
": missing FunctionInfo Size", Offset);
44 "0x%8.8" PRIx64
": missing FunctionInfo Name", Offset);
48 "0x%8.8" PRIx64
": invalid FunctionInfo Name value 0x%8.8x",
54 "0x%8.8" PRIx64
": missing FunctionInfo InfoType value", Offset);
58 "0x%8.8" PRIx64
": missing FunctionInfo InfoType length", Offset);
62 "0x%8.8" PRIx64
": missing FunctionInfo data for InfoType %u",
76 return LT.takeError();
81 FI.
Inline = std::move(II.get());
83 return II.takeError();
88 "0x%8.8" PRIx64
": unsupported InfoType %u",
99 "attempted to encode invalid FunctionInfo object");
102 const uint64_t FuncInfoOffset = O.
tell();
114 const auto StartOffset = O.
tell();
117 return std::move(err);
118 const auto Length = O.
tell() - StartOffset;
119 if (Length > UINT32_MAX)
121 "LineTable length is greater than UINT32_MAX");
123 O.
fixup32(static_cast<uint32_t>(Length), StartOffset - 4);
132 const auto StartOffset = O.
tell();
135 return std::move(err);
136 const auto Length = O.
tell() - StartOffset;
137 if (Length > UINT32_MAX)
139 "InlineInfo length is greater than UINT32_MAX");
141 O.
fixup32(static_cast<uint32_t>(Length), StartOffset - 4);
147 return FuncInfoOffset;
166 "FunctionInfo data is truncated");
172 "address 0x%" PRIx64
" is not in GSYM", Addr);
176 "0x%8.8" PRIx64
": invalid FunctionInfo Name value 0x00000000",
185 "FunctionInfo data is truncated");
189 if (InfoLength != InfoBytes.
size())
191 "FunctionInfo data is truncated");
201 LineEntry = ExpectedLE.get();
203 return ExpectedLE.takeError();
209 InlineInfoData = InfoData;
215 Offset += InfoLength;
230 "failed to extract file[%" PRIu32
"]",
247 return std::move(Err);
GsymReader is used to read GSYM data from a file or buffer.
llvm::Optional< LineTable > OptLineTable
InfoType
FunctionInfo information type that is used to encode the optional data that is associated with a Func...
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.
StringRef FuncName
The concrete function name that contains LookupAddr.
This class represents lattice values for constants.
StringRef Dir
Line entry source file directory path.
Inline information stores the name of the inline function along with an array of address ranges...
Line entries are used to encode the line tables in FunctionInfo objects.
uint32_t Line
Source file line number.
void alignTo(size_t Align)
Pad with zeroes at the current file position until the current file position matches the specified al...
llvm::Optional< InlineInfo > Inline
uint32_t Dir
Offsets in the string table.
Function information in GSYM files encodes information for one contiguous address range...
void fixup32(uint32_t Value, uint64_t Offset)
Fixup a uint32_t value at the specified offset in the stream.
void writeU32(uint32_t Value)
Write a single uint32_t value into the stream at the current file position.
static llvm::Expected< LookupResult > lookup(DataExtractor &Data, const GsymReader &GR, uint64_t FuncAddr, uint64_t Addr)
Lookup an address within a FunctionInfo object's data stream.
Tagged union holding either a T or a Error.
LLVM_NODISCARD StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
uint64_t LookupAddr
The address that this lookup pertains to.
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.
uint32_t File
1 based index of file in FileTable
LLVM_NODISCARD size_t size() const
size - Get the string size.
bool isValid() const
Query if a FunctionInfo object is valid.
SourceLocations Locations
The source locations that match this address.
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.
StringRef Name
Function or symbol name.
static llvm::Expected< LineTable > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an LineTable object from a binary data stream.
AddressRange FuncRange
The concrete function address range.
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::ZeroOrMore, cl::values(clEnumValN(DefaultIT, "arm-default-it", "Generate IT block based on arch"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow deprecated IT based on ARMv8"), clEnumValN(NoRestrictedIT, "arm-no-restrict-it", "Allow IT blocks based on ARMv7")))
static llvm::Expected< FunctionInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an object from a binary data stream.
uint32_t Name
String table offset in the string table.
llvm::Expected< uint64_t > encode(FileWriter &O) const
Encode this object into FileWriter stream.
uint64_t tell()
Return the current offset within the file.
static Expected< LineEntry > lookup(DataExtractor &Data, uint64_t BaseAddr, uint64_t Addr)
Lookup a single address within a line table's data.
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...
StringRef - Represent a constant reference to a string, i.e.
uint32_t Line
Source line number.
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.