9 #ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H 10 #define LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H 29 class RuntimeDyldCheckerImpl;
82 : ContentPtr(Content.data()), Size(Content.
size()),
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");
98 ContentPtr = Content.
data();
99 Size = Content.
size();
104 assert(!ContentPtr && !this->Size &&
"Content/zero-fill already set");
111 return StringRef(ContentPtr, static_cast<size_t>(Size));
122 assert(!this->TargetAddress &&
"TargetAddress already set");
123 this->TargetAddress = TargetAddress;
130 const char *ContentPtr = 0;
147 GetSectionInfoFunction GetSectionInfo,
148 GetStubInfoFunction GetStubInfo,
149 GetGOTInfoFunction GetGOTInfo,
179 std::unique_ptr<RuntimeDyldCheckerImpl> Impl;
bool checkAllRulesInBuffer(StringRef RulePrefix, MemoryBuffer *MemBuf) const
Scan the given memory buffer for lines beginning with the string in RulePrefix.
This class represents lattice values for constants.
Superclass for all disassemblers.
MemoryRegionInfo(uint64_t Size, JITTargetAddress TargetAddress)
Constructor for zero-fill symbols/sections.
constexpr support::endianness Endianness
The endianness of all multi-byte encoded values in MessagePack.
JITTargetAddress getTargetAddress() const
Return the target address for this region.
MemoryRegionInfo()=default
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
Optional< uint64_t > getSectionLoadAddress(void *LocalAddress) const
If there is a section at the given local address, return its load address, otherwise return none...
void setContent(StringRef Content)
Set the content for this memory region.
MemoryRegionInfo(StringRef Content, JITTargetAddress TargetAddress)
Constructor for symbols/sections with content.
std::function< Expected< MemoryRegionInfo >(StringRef GOTContainer, StringRef TargetName)> GetGOTInfoFunction
LLVM_NODISCARD size_t size() const
size - Get the string size.
uint64_t JITTargetAddress
Represents an address in the target process's address space.
std::function< bool(StringRef Symbol)> IsSymbolValidFunction
std::function< Expected< MemoryRegionInfo >(StringRef SymbolName)> GetSymbolInfoFunction
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...
RuntimeDyld invariant checker for verifying that RuntimeDyld has correctly applied relocations...
std::function< Expected< MemoryRegionInfo >(StringRef StubContainer, StringRef TargetName)> GetStubInfoFunction
bool check(StringRef CheckExpr) const
Check a single expression against the attached RuntimeDyld instance.
bool isZeroFill() const
Returns true if this is a zero-fill symbol/section.
uint64_t getZeroFillLength() const
Returns the zero-fill length for this section.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
This interface provides simple read-only access to a block of memory, and provides simple methods for...
StringRef getContent() const
Returns the content for this section if there is any.
RuntimeDyldChecker(IsSymbolValidFunction IsSymbolValid, GetSymbolInfoFunction GetSymbolInfo, GetSectionInfoFunction GetSectionInfo, GetStubInfoFunction GetStubInfo, GetGOTInfoFunction GetGOTInfo, support::endianness Endianness, MCDisassembler *Disassembler, MCInstPrinter *InstPrinter, raw_ostream &ErrStream)
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
void setZeroFill(uint64_t Size)
Set a zero-fill length for this memory region.
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::function< Expected< MemoryRegionInfo >(StringRef FileName, StringRef SectionName)> GetSectionInfoFunction
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.
void setTargetAddress(JITTargetAddress TargetAddress)
Set the target address for this region.