Go to the documentation of this file.
9 #ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H
10 #define LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H
29 class RuntimeDyldCheckerImpl;
83 TargetAddress(TargetAddress) {}
87 : Size(Size), TargetAddress(TargetAddress) {}
91 assert(Size &&
"setContent/setZeroFill must be called first");
97 assert(!ContentPtr && !Size &&
"Content/zero-fill already set");
104 assert(!ContentPtr && !this->Size &&
"Content/zero-fill already set");
111 return {ContentPtr,
static_cast<size_t>(Size)};
122 assert(!this->TargetAddress &&
"TargetAddress already set");
123 this->TargetAddress = TargetAddress;
130 const char *ContentPtr =
nullptr;
179 std::unique_ptr<RuntimeDyldCheckerImpl> Impl;
std::function< bool(StringRef Symbol)> IsSymbolValidFunction
void setZeroFill(uint64_t Size)
Set a zero-fill length for this memory region.
This is an optimization pass for GlobalISel generic memory operations.
constexpr support::endianness Endianness
The endianness of all multi-byte encoded values in MessagePack.
MemoryRegionInfo(uint64_t Size, JITTargetAddress TargetAddress)
Constructor for zero-fill symbols/sections.
bool check(StringRef CheckExpr) const
Check a single expression against the attached RuntimeDyld instance.
JITTargetAddress getTargetAddress() const
Return the target address for this region.
RuntimeDyldChecker(IsSymbolValidFunction IsSymbolValid, GetSymbolInfoFunction GetSymbolInfo, GetSectionInfoFunction GetSectionInfo, GetStubInfoFunction GetStubInfo, GetGOTInfoFunction GetGOTInfo, support::endianness Endianness, MCDisassembler *Disassembler, MCInstPrinter *InstPrinter, raw_ostream &ErrStream)
This interface provides simple read-only access to a block of memory, and provides simple methods for...
bool isZeroFill() const
Returns true if this is a zero-fill symbol/section.
void setContent(ArrayRef< char > Content)
Set the content for this memory region.
std::function< Expected< MemoryRegionInfo >(StringRef GOTContainer, StringRef TargetName)> GetGOTInfoFunction
std::pair< uint64_t, std::string > getSectionAddr(StringRef FileName, StringRef SectionName, bool LocalAddress)
Returns the address of the requested section (or an error message in the second element of the pair i...
This class implements an extremely fast bulk output stream that can only output to a stream.
MemoryRegionInfo(ArrayRef< char > Content, JITTargetAddress TargetAddress)
Constructor for symbols/sections with content.
std::function< Expected< MemoryRegionInfo >(StringRef FileName, StringRef SectionName)> GetSectionInfoFunction
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Superclass for all disassemblers.
Optional< uint64_t > getSectionLoadAddress(void *LocalAddress) const
If there is a section at the given local address, return its load address, otherwise return none.
std::function< Expected< MemoryRegionInfo >(StringRef SymbolName)> GetSymbolInfoFunction
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
print Print MemDeps of function
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
StringRef - Represent a constant reference to a string, i.e.
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
uint64_t getZeroFillLength() const
Returns the zero-fill length for this section.
RuntimeDyld invariant checker for verifying that RuntimeDyld has correctly applied relocations.
bool checkAllRulesInBuffer(StringRef RulePrefix, MemoryBuffer *MemBuf) const
Scan the given memory buffer for lines beginning with the string in RulePrefix.
MemoryRegionInfo()=default
std::function< Expected< MemoryRegionInfo >(StringRef StubContainer, StringRef TargetName)> GetStubInfoFunction
ArrayRef< char > getContent() const
Returns the content for this section if there is any.
void setTargetAddress(JITTargetAddress TargetAddress)
Set the target address for this region.