DatabaseExperiment: add register FI
Calling the DatabaseCampaign with --inject-registers or --force-inject-registers now injects into CPU registers. This is achieved by reinterpreting data addresses in the DB as addresses within the register file. (The mapping between registers and data addresses is implemented in core/util/llvmdisassembler/LLVMtoFailTranslator.hpp.) The difference between --inject-registers and --force-inject-registers is what the experiment does when a data address is not interpretable as a register: the former option then injects into memory (DatabaseCampaignMessage, RegisterInjectionMode AUTO), the latter skips the injection altogether (FORCE). Currently only compiles together with the Bochs backend; the DatabaseExperiment's redecodeCurrentInstruction() function must be moved into the Bochs EEA to remedy this. Change-Id: I23f152ac0adf4cb6fbe82377ac871e654263fe57
This commit is contained in:
@ -57,14 +57,14 @@ int main(int argc, char* argv[]) {
|
||||
for (std::vector<uint16_t>::const_iterator it = instr.reg_uses.begin();
|
||||
it != instr.reg_uses.end(); ++it) {
|
||||
std::cout << reg_info.getName(*it)
|
||||
<< "(" << *it << "->" << ltof->getFailRegisterId(*it) << ") ";
|
||||
<< "(" << *it << "->" << ltof->getFailRegisterID(*it) << ") ";
|
||||
}
|
||||
|
||||
std::cout << " | DEFS: ";
|
||||
for (std::vector<uint16_t>::const_iterator it = instr.reg_defs.begin();
|
||||
it != instr.reg_defs.end(); ++it) {
|
||||
std::cout << reg_info.getName(*it)
|
||||
<< "(" << *it << "->" << ltof->getFailRegisterId(*it) << ") ";
|
||||
<< "(" << *it << "->" << ltof->getFailRegisterID(*it) << ") ";
|
||||
}
|
||||
|
||||
if (instr.conditional_branch) {
|
||||
|
||||
Reference in New Issue
Block a user