Go to the documentation of this file.
40 if (!
Data.isValidOffsetForDataOfSize(Offset, 4))
42 "0x%8.8" PRIx64
": missing FunctionInfo Size", Offset);
43 FI.
Range = {BaseAddr, BaseAddr +
Data.getU32(&Offset)};
44 if (!
Data.isValidOffsetForDataOfSize(Offset, 4))
46 "0x%8.8" PRIx64
": missing FunctionInfo Name", Offset);
50 "0x%8.8" PRIx64
": invalid FunctionInfo Name value 0x%8.8x",
54 if (!
Data.isValidOffsetForDataOfSize(Offset, 4))
56 "0x%8.8" PRIx64
": missing FunctionInfo InfoType value", Offset);
58 if (!
Data.isValidOffsetForDataOfSize(Offset, 4))
60 "0x%8.8" PRIx64
": missing FunctionInfo InfoType length", Offset);
62 if (!
Data.isValidOffsetForDataOfSize(Offset, InfoLength))
64 "0x%8.8" PRIx64
": missing FunctionInfo data for InfoType %u",
67 Data.isLittleEndian(),
68 Data.getAddressSize());
78 return LT.takeError();
85 return II.takeError();
90 "0x%8.8" PRIx64
": unsupported InfoType %u",
101 "attempted to encode invalid FunctionInfo object");
104 const uint64_t FuncInfoOffset =
O.tell();
116 const auto StartOffset =
O.tell();
120 const auto Length =
O.tell() - StartOffset;
121 if (Length > UINT32_MAX)
123 "LineTable length is greater than UINT32_MAX");
125 O.fixup32(
static_cast<uint32_t>(Length), StartOffset - 4);
134 const auto StartOffset =
O.tell();
138 const auto Length =
O.tell() - StartOffset;
139 if (Length > UINT32_MAX)
141 "InlineInfo length is greater than UINT32_MAX");
143 O.fixup32(
static_cast<uint32_t>(Length), StartOffset - 4);
149 return FuncInfoOffset;
165 if (!
Data.isValidOffset(Offset))
167 "FunctionInfo data is truncated");
173 "address 0x%" PRIx64
" is not in GSYM",
Addr);
177 "0x%8.8" PRIx64
": invalid FunctionInfo Name value 0x00000000",
184 if (!
Data.isValidOffsetForDataOfSize(Offset, 8))
186 "FunctionInfo data is truncated");
189 const StringRef InfoBytes =
Data.getData().substr(Offset, InfoLength);
190 if (InfoLength != InfoBytes.
size())
192 "FunctionInfo data is truncated");
194 Data.getAddressSize());
204 return ExpectedLE.takeError();
210 InlineInfoData = InfoData;
216 Offset += InfoLength;
232 "failed to extract file[%" PRIu32
"]",
This is an optimization pass for GlobalISel generic memory operations.
uint32_t Name
String table offset in the string table.
Line entries are used to encode the line tables in FunctionInfo objects.
bool isValid() const
Query if a FunctionInfo object is valid.
llvm::Optional< LineTable > OptLineTable
SourceLocations Locations
The source locations that match this address.
StringRef Name
Function or symbol name.
Tagged union holding either a T or a Error.
Inline information stores the name of the inline function along with an array of address ranges.
StringRef Dir
Line entry source file directory path.
uint32_t Offset
Byte size offset within the named function.
uint32_t File
1 based index of file in FileTable
uint32_t Dir
Offsets in the string table.
GsymReader is used to read GSYM data from a file or buffer.
raw_ostream & operator<<(raw_ostream &OS, const FunctionInfo &R)
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an InlineInfo object from a binary data stream.
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.
InfoType
FunctionInfo information type that is used to encode the optional data that is associated with a Func...
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.
This class implements an extremely fast bulk output stream that can only output to a stream.
llvm::Optional< InlineInfo > Inline
Function information in GSYM files encodes information for one contiguous address range.
static Expected< LineEntry > lookup(DataExtractor &Data, uint64_t BaseAddr, uint64_t Addr)
Lookup a single address within a line table's data.
AddressRange FuncRange
The concrete function address range.
uint32_t Line
Source line number.
static llvm::Expected< FunctionInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an object from a binary data stream.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
llvm::Expected< uint64_t > encode(FileWriter &O) const
Encode this object into FileWriter stream.
uint64_t LookupAddr
The address that this lookup pertains to.
A simplified binary data writer class that doesn't require targets, target definitions,...
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 any type of IT block"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow complex IT blocks")))
StringRef Base
Line entry source file basename.
StringRef - Represent a constant reference to a string, i.e.
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Lightweight error class with error context and mandatory checking.
StringRef FuncName
The concrete function name that contains LookupAddr.
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.
bool contains(uint64_t Addr) const
uint32_t Line
Source file line number.
static llvm::Expected< LineTable > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an LineTable object from a binary data stream.