database-experiment: no abort on injection_instr_absolute==NULL

The injection_instr_absolute can be NULL, if the trace was imported by
--faultspace-rightmargin R. The database-experiment then aborted the
injection, since a non present injection instruction is encoded as 0,
which is != 0.

Change-Id: I0abcbf102e8b26678ea574d6f73741c2cfac6781
This commit is contained in:
Christian Dietrich
2015-08-05 09:01:48 +02:00
parent 65e4409c90
commit f7c9917f7e

View File

@ -146,8 +146,12 @@ bool DatabaseExperiment::run()
found_eip = true;
}
}
if (!found_eip) {
m_log << "Invalid Injection address != 0x" << injection_instr_absolute << std::endl;
if (fsppilot->has_injection_instr_absolute() && !found_eip) {
m_log << "Invalid Injection address != 0x" << std::hex << injection_instr_absolute<< std::endl;
for (size_t i = 0; i < simulator.getCPUCount(); i++) {
address_t eip = simulator.getCPU(i).getInstructionPointer();
m_log << " CPU " << i << " EIP = 0x" << std::hex << eip << std::dec << std::endl;
}
simulator.terminate(1);
}