BochsController.cc is back
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1013 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -1,10 +1,18 @@
|
||||
set(SRCS
|
||||
Memory.cc
|
||||
Register.cc
|
||||
SimulatorController.cc
|
||||
${VARIANT}/Controller.cc
|
||||
)
|
||||
if(BUILD_BOCHS)
|
||||
set(SRCS
|
||||
Memory.cc
|
||||
Register.cc
|
||||
SimulatorController.cc
|
||||
bochs/BochsController.cc
|
||||
)
|
||||
else()
|
||||
set(SRCS
|
||||
Memory.cc
|
||||
Register.cc
|
||||
SimulatorController.cc
|
||||
${VARIANT}/Controller.cc
|
||||
)
|
||||
endif(BUILD_BOCHS)
|
||||
|
||||
|
||||
add_library(SAL ${SRCS})
|
||||
|
||||
|
||||
@ -24,33 +24,27 @@ bool hscsimpleExperiment::run()
|
||||
// do funny things here...
|
||||
#if 1
|
||||
// STEP 1
|
||||
fi::BPEvent mainbp(0x00003c34);
|
||||
sal::simulator.addEventAndWait(&mainbp);
|
||||
log << "breakpoint reached, saving" << endl;
|
||||
sal::simulator.save("hello.state");
|
||||
//sal::simulator.dbgEnableInstrPtrOutput(500);
|
||||
while(1){
|
||||
int j = 0;
|
||||
for(j=0 ; j<=50 ; j++){
|
||||
cout << "durch" << endl;
|
||||
fi::BPEvent mainbp(0x1045f5);
|
||||
//fi::BPEvent mainbp(0x105bfa);
|
||||
sal::simulator.addEventAndWait(&mainbp);
|
||||
}
|
||||
|
||||
int i;
|
||||
for(i=0 ; i<= 0 ; i++){
|
||||
cout << "Interrupt wird ausgeloest" << endl;
|
||||
//sleep(1);
|
||||
sal::simulator.fireInterrupt(9);
|
||||
}
|
||||
}
|
||||
#elif 1
|
||||
// STEP 2
|
||||
log << "restoring ..." << endl;
|
||||
sal::simulator.restore("hello.state");
|
||||
log << "restored!" << endl;
|
||||
sal::simulator.dbgEnableInstrPtrOutput(500);
|
||||
|
||||
log << "waiting for last square() instruction" << endl;
|
||||
fi::BPEvent breakpoint(0x3c9e); // square(x) ret instruction
|
||||
sal::simulator.addEventAndWait(&breakpoint);
|
||||
log << "injecting hellish fault" << endl;
|
||||
#if BX_SUPPORT_X86_64
|
||||
int reg = sal::RID_RAX;
|
||||
#else
|
||||
int reg = sal::RID_EAX;
|
||||
#endif
|
||||
sal::simulator.getRegisterManager().getRegister(reg)->setData(666);
|
||||
log << "waiting for last main() instruction" << endl;
|
||||
breakpoint.setWatchInstructionPointer(0x3c92);
|
||||
sal::simulator.addEventAndWait(&breakpoint);
|
||||
|
||||
log << "reached" << endl;
|
||||
|
||||
sal::simulator.addEventAndWait(&breakpoint);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user