From b15f5d79ac5dfc75a6e356c96ffc463c2223611b Mon Sep 17 00:00:00 2001 From: unzner Date: Thu, 11 Oct 2012 10:51:07 +0000 Subject: [PATCH] Handles a bound I forgot git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1735 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- src/experiments/l4-sys/experiment.cc | 32 ++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/experiments/l4-sys/experiment.cc b/src/experiments/l4-sys/experiment.cc index b10aaa7a..2809b518 100644 --- a/src/experiments/l4-sys/experiment.cc +++ b/src/experiments/l4-sys/experiment.cc @@ -499,7 +499,21 @@ bool L4SysExperiment::run() { /* ============================================ */ /* end Bjoern Doebel's code (slightly modified) */ - } while (which == UD_NONE); + } while (which == UD_NONE && + simulator.getRegisterManager().getInstructionPointer() != L4SYS_FUNC_EXIT); + + if (simulator.getRegisterManager().getInstructionPointer() == L4SYS_FUNC_EXIT) { + param.msg.set_resulttype(param.msg.UNKNOWN); + param.msg.set_resultdata( + simulator.getRegisterManager().getInstructionPointer()); + param.msg.set_output(sanitised(output.c_str())); + + stringstream ss; + ss << "Reached the end of the experiment without finding an appropriate instruction" << endl; + param.msg.set_details(ss.str()); + m_jc.sendResult(param); + simulator.terminate(33); + } // store the real injection point param.msg.set_injection_ip(simulator.getRegisterManager().getInstructionPointer()); @@ -563,10 +577,24 @@ bool L4SysExperiment::run() { bxInstruction_c *currInstr; while (!aluInstrObject.isALUInstruction( - currInstr = simulator.getCurrentInstruction())) { + currInstr = simulator.getCurrentInstruction()) && + simulator.getRegisterManager().getInstructionPointer() != L4SYS_FUNC_EXIT) { singleStep(); } + if (simulator.getRegisterManager().getInstructionPointer() == L4SYS_FUNC_EXIT) { + param.msg.set_resulttype(param.msg.UNKNOWN); + param.msg.set_resultdata( + simulator.getRegisterManager().getInstructionPointer()); + param.msg.set_output(sanitised(output.c_str())); + + stringstream ss; + ss << "Reached the end of the experiment without finding an appropriate instruction" << endl; + param.msg.set_details(ss.str()); + m_jc.sendResult(param); + simulator.terminate(33); + } + // store the real injection point param.msg.set_injection_ip(simulator.getRegisterManager().getInstructionPointer());