From f7c9917f7efcd36743a74139d18708370ce18672 Mon Sep 17 00:00:00 2001 From: Christian Dietrich Date: Wed, 5 Aug 2015 09:01:48 +0200 Subject: [PATCH] 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 --- src/core/efw/DatabaseExperiment.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/efw/DatabaseExperiment.cc b/src/core/efw/DatabaseExperiment.cc index ed74cd99..7cc67d30 100644 --- a/src/core/efw/DatabaseExperiment.cc +++ b/src/core/efw/DatabaseExperiment.cc @@ -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); }