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());
71 case InfoType::EndOfList:
75 case InfoType::LineTableInfo:
79 return LT.takeError();
82 case InfoType::InlineInfo:
84 FI.
Inline = std::move(II.get());
86 return II.takeError();
91 "0x%8.8" PRIx64
": unsupported InfoType %u",
117 "attempted to encode invalid FunctionInfo object");
130 return FuncInfoOffset;
139 Out.
writeU32(InfoType::LineTableInfo);
143 const auto StartOffset = Out.
tell();
146 return std::move(err);
150 "LineTable length is greater than UINT32_MAX");
161 const auto StartOffset = Out.
tell();
164 return std::move(err);
168 "InlineInfo length is greater than UINT32_MAX");
176 return FuncInfoOffset;
194 "FunctionInfo data is truncated");
200 "address 0x%" PRIx64
" is not in GSYM",
Addr);
204 "0x%8.8" PRIx64
": invalid FunctionInfo Name value 0x00000000",
209 std::optional<DataExtractor> InlineInfoData;
211 if (!
Data.isValidOffsetForDataOfSize(
Offset, 8))
213 "FunctionInfo data is truncated");
217 if (InfoLength != InfoBytes.
size())
219 "FunctionInfo data is truncated");
221 Data.getAddressSize());
223 case InfoType::EndOfList:
227 case InfoType::LineTableInfo:
231 return ExpectedLE.takeError();
234 case InfoType::InlineInfo:
237 InlineInfoData = InfoData;
259 "failed to extract file[%" PRIu32
"]",
277 return std::move(Err);
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::values(clEnumValN(DefaultIT, "arm-default-it", "Generate any type of IT block"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow complex IT blocks")))
InfoType
FunctionInfo information type that is used to encode the optional data that is associated with a Func...
bool contains(uint64_t Addr) const
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.
pointer data()
Return a pointer to the vector's buffer, even if empty().
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
A simplified binary data writer class that doesn't require targets, target definitions,...
uint64_t tell()
Return the current offset within the file.
void fixup32(uint32_t Value, uint64_t Offset)
Fixup a uint32_t value at the specified offset in the stream.
llvm::support::endianness getByteOrder() const
void alignTo(size_t Align)
Pad with zeroes at the current file position until the current file position matches the specified al...
void writeU32(uint32_t Value)
Write a single uint32_t value into the stream at the current file position.
void writeData(llvm::ArrayRef< uint8_t > Data)
Write an array of uint8_t values into the stream at the current file position.
GsymReader is used to read GSYM data from a file or buffer.
std::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.
static llvm::Expected< LineTable > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an LineTable object from a binary data stream.
static Expected< LineEntry > lookup(DataExtractor &Data, uint64_t BaseAddr, uint64_t Addr)
Lookup a single address within a line table's data.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
raw_ostream & operator<<(raw_ostream &OS, const FunctionInfo &R)
constexpr endianness system_endianness()
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
void consumeError(Error Err)
Consume a Error without doing anything.
Function information in GSYM files encodes information for one contiguous address range.
std::optional< InlineInfo > Inline
bool isValid() const
Query if a FunctionInfo object is valid.
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.
uint64_t cacheEncoding()
Encode this function info into the internal byte cache and return the size in bytes.
uint32_t Name
String table offset in the string table.
SmallString< 32 > EncodingCache
If we encode a FunctionInfo during segmenting so we know its size, we can cache that encoding here so...
std::optional< LineTable > OptLineTable
llvm::Expected< uint64_t > encode(FileWriter &O) const
Encode this object into FileWriter stream.
Inline information stores the name of the inline function along with an array of address ranges.
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.
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an InlineInfo object from a binary data stream.
Line entries are used to encode the line tables in FunctionInfo objects.
uint32_t File
1 based index of file in FileTable
uint32_t Line
Source line number.
uint64_t LookupAddr
The address that this lookup pertains to.
AddressRange FuncRange
The concrete function address range.
StringRef FuncName
The concrete function name that contains LookupAddr.
SourceLocations Locations
The source locations that match this address.
StringRef Base
Line entry source file basename.
uint32_t Line
Source file line number.
uint32_t Offset
Byte size offset within the named function.
StringRef Dir
Line entry source file directory path.
StringRef Name
Function or symbol name.