Make FailBochs compile again (after changes in r1966).

For now, only breakpoints are working. Other event sources need to be revised, too.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1981 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-12-12 13:08:43 +00:00
parent 2010d4c385
commit f8aa1237e9
8 changed files with 192 additions and 50 deletions

View File

@ -8,6 +8,7 @@
#include "bochs.h"
#include "cpu/cpu.h"
#include "gui/siminterface.h" // for BX_SMP_PROCESSORS
#include "../SALInst.hpp"
@ -22,9 +23,20 @@ aspect Breakpoints {
// Points to the *current* bxInstruction-object
bxInstruction_c* pInstr = *(tjp->arg<1>());
// Detect the CPU that triggered the change:
unsigned i = 0;
#if BX_SUPPORT_SMP
for (; i < BX_SMP_PROCESSORS; i++) {
if (BX_CPU_C[i] == pThis) // cmp this ptr with all possible CPU objects
break; // index "i" found! -> stop!
}
#endif
fail::ConcreteCPU& triggerCPU = fail::simulator.getCPU(i);
// FIXME: slice ConcreteCPU object reference into BOCHS_CPU -> simplified
// Report this event to the Bochs controller:
fail::simulator.updateBPEventInfo(pThis, pInstr);
fail::simulator.onBreakpoint(pThis->get_instruction_pointer(), pThis->cr3);
fail::simulator.onBreakpoint(&triggerCPU, pThis->get_instruction_pointer(), pThis->cr3);
// Note: get_bx_opcode_name(pInstr->getIaOpcode()) retrieves the mnemonics.
}
};