|
LLVM
4.0.0
|
RuntimeDyld invariant checker for verifying that RuntimeDyld has correctly applied relocations. More...
#include <RuntimeDyldChecker.h>
Public Member Functions | |
| RuntimeDyldChecker (RuntimeDyld &RTDyld, MCDisassembler *Disassembler, MCInstPrinter *InstPrinter, raw_ostream &ErrStream) | |
| ~RuntimeDyldChecker () | |
| RuntimeDyld & | getRTDyld () |
| const RuntimeDyld & | getRTDyld () const |
| bool | check (StringRef CheckExpr) const |
| Check a single expression against the attached RuntimeDyld instance. More... | |
| bool | checkAllRulesInBuffer (StringRef RulePrefix, MemoryBuffer *MemBuf) const |
| Scan the given memory buffer for lines beginning with the string in RulePrefix. More... | |
| 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 if the address cannot be found). More... | |
RuntimeDyld invariant checker for verifying that RuntimeDyld has correctly applied relocations.
The RuntimeDyldChecker class evaluates expressions against an attached RuntimeDyld instance to verify that relocations have been applied correctly.
The expression language supports basic pointer arithmetic and bit-masking, and has limited disassembler integration for accessing instruction operands and the next PC (program counter) address for each instruction.
The language syntax is:
check = expr '=' expr
expr = binary_expr | sliceable_expr
sliceable_expr = '*{' number '}' load_addr_expr [slice] | '(' expr ')' [slice] | ident_expr [slice] | number [slice]
slice = '[' high-bit-index ':' low-bit-index ']'
load_addr_expr = symbol | '(' symbol '+' number ')' | '(' symbol '-' number ')'
ident_expr = 'decode_operand' '(' symbol ',' operand-index ')' | 'next_pc' '(' symbol ')' | 'stub_addr' '(' file-name ',' section-name ',' symbol ')' | symbol
binary_expr = expr '+' expr | expr '-' expr | expr '&' expr | expr '|' expr | expr '<<' expr | expr '>>' expr
Definition at line 69 of file RuntimeDyldChecker.h.
| RuntimeDyldChecker::RuntimeDyldChecker | ( | RuntimeDyld & | RTDyld, |
| MCDisassembler * | Disassembler, | ||
| MCInstPrinter * | InstPrinter, | ||
| raw_ostream & | ErrStream | ||
| ) |
Definition at line 907 of file RuntimeDyldChecker.cpp.
| RuntimeDyldChecker::~RuntimeDyldChecker | ( | ) |
Definition at line 914 of file RuntimeDyldChecker.cpp.
Check a single expression against the attached RuntimeDyld instance.
Definition at line 924 of file RuntimeDyldChecker.cpp.
| bool RuntimeDyldChecker::checkAllRulesInBuffer | ( | StringRef | RulePrefix, |
| MemoryBuffer * | MemBuf | ||
| ) | const |
Scan the given memory buffer for lines beginning with the string in RulePrefix.
The remainder of the line is passed to the check method to be evaluated as an expression.
Definition at line 928 of file RuntimeDyldChecker.cpp.
| RuntimeDyld & RuntimeDyldChecker::getRTDyld | ( | ) |
Definition at line 916 of file RuntimeDyldChecker.cpp.
| const RuntimeDyld & RuntimeDyldChecker::getRTDyld | ( | ) | const |
Definition at line 920 of file RuntimeDyldChecker.cpp.
| std::pair< uint64_t, std::string > RuntimeDyldChecker::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 if the address cannot be found).
if 'LocalAddress' is true, this returns the address of the section within the linker's memory. If 'LocalAddress' is false it returns the address within the target process (i.e. the load address).
Definition at line 934 of file RuntimeDyldChecker.cpp.
1.8.6