41 if (!
Data.isValidOffsetForDataOfSize(
Offset, 4))
43 "0x%8.8" PRIx64
": missing FunctionInfo Size",
Offset);
45 if (!
Data.isValidOffsetForDataOfSize(
Offset, 4))
47 "0x%8.8" PRIx64
": missing FunctionInfo Name",
Offset);
51 "0x%8.8" PRIx64
": invalid FunctionInfo Name value 0x%8.8x",
55 if (!
Data.isValidOffsetForDataOfSize(
Offset, 4))
57 "0x%8.8" PRIx64
": missing FunctionInfo InfoType value",
Offset);
59 if (!
Data.isValidOffsetForDataOfSize(
Offset, 4))
61 "0x%8.8" PRIx64
": missing FunctionInfo InfoType length",
Offset);
63 if (!
Data.isValidOffsetForDataOfSize(
Offset, InfoLength))
65 "0x%8.8" PRIx64
": missing FunctionInfo data for InfoType %u",
68 Data.isLittleEndian(),
69 Data.getAddressSize());
79 return LT.takeError();
86 return II.takeError();
91 "0x%8.8" PRIx64
": unsupported InfoType %u",
102 "attempted to encode invalid FunctionInfo object");
105 const uint64_t FuncInfoOffset =
O.tell();
117 const auto StartOffset =
O.tell();
121 const auto Length =
O.tell() - StartOffset;
122 if (Length > UINT32_MAX)
124 "LineTable length is greater than UINT32_MAX");
126 O.fixup32(static_cast<uint32_t>(Length), StartOffset - 4);
135 const auto StartOffset =
O.tell();
139 const auto Length =
O.tell() - StartOffset;
140 if (Length > UINT32_MAX)
142 "InlineInfo length is greater than UINT32_MAX");
144 O.fixup32(static_cast<uint32_t>(Length), StartOffset - 4);
150 return FuncInfoOffset;
169 "FunctionInfo data is truncated");
175 "address 0x%" PRIx64
" is not in GSYM",
Addr);
179 "0x%8.8" PRIx64
": invalid FunctionInfo Name value 0x00000000",
186 if (!
Data.isValidOffsetForDataOfSize(
Offset, 8))
188 "FunctionInfo data is truncated");
192 if (InfoLength != InfoBytes.
size())
194 "FunctionInfo data is truncated");
196 Data.getAddressSize());
206 return ExpectedLE.takeError();
212 InlineInfoData = InfoData;
234 "failed to extract file[%" PRIu32
"]",
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.
bool contains(uint64_t Addr) const
Line entries are used to encode the line tables in FunctionInfo objects.
uint32_t Line
Source file line number.
llvm::Optional< InlineInfo > Inline
uint32_t Dir
Offsets in the string table.
Function information in GSYM files encodes information for one contiguous address range.
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.
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,...
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.
uint32_t Offset
Byte size offset within the named function.
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.
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.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
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.