bochs: restore original RIP increase behavior
The now commented-out variant that was introduced in commit be9d291
(when FAIL* was still in an SVN repo, r1702) may be necessary for some
specific system behavior after modifying the currently executed
instruction, but breaks random-jump FI (import-trace -i
RandomJumpImporter).
Change-Id: I1ef3dc6dceab66b01cddd988e0f201065e404f99
This commit is contained in:
@ -151,16 +151,22 @@ void BX_CPU_C::cpu_loop(Bit32u max_instr_count)
|
|||||||
debug_disasm_instruction(BX_CPU_THIS_PTR prev_rip);
|
debug_disasm_instruction(BX_CPU_THIS_PTR prev_rip);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if 0
|
||||||
// DanceOS: Save original instruction length in case we modify the instruction.
|
// DanceOS: Save original instruction length in case we modify the instruction.
|
||||||
unsigned orig_len = i->ilen();
|
unsigned orig_len = i->ilen();
|
||||||
|
#endif
|
||||||
// DanceOS: Aspect "hook"
|
// DanceOS: Aspect "hook"
|
||||||
defineCPULoopJoinPoint(BX_CPU_THIS, i);
|
defineCPULoopJoinPoint(BX_CPU_THIS, i);
|
||||||
|
|
||||||
// instruction decoding completed -> continue with execution
|
// instruction decoding completed -> continue with execution
|
||||||
// want to allow changing of the instruction inside instrumentation callback
|
// want to allow changing of the instruction inside instrumentation callback
|
||||||
BX_INSTR_BEFORE_EXECUTION(BX_CPU_ID, i);
|
BX_INSTR_BEFORE_EXECUTION(BX_CPU_ID, i);
|
||||||
|
#if 0
|
||||||
// DanceOS: Use original length (see above).
|
// DanceOS: Use original length (see above).
|
||||||
RIP += orig_len;
|
RIP += orig_len;
|
||||||
|
#else
|
||||||
|
RIP += i->ilen();
|
||||||
|
#endif
|
||||||
BX_CPU_CALL_METHOD(i->execute, (i)); // might iterate repeat instruction
|
BX_CPU_CALL_METHOD(i->execute, (i)); // might iterate repeat instruction
|
||||||
BX_CPU_THIS_PTR prev_rip = RIP; // commit new RIP
|
BX_CPU_THIS_PTR prev_rip = RIP; // commit new RIP
|
||||||
BX_INSTR_AFTER_EXECUTION(BX_CPU_ID, i);
|
BX_INSTR_AFTER_EXECUTION(BX_CPU_ID, i);
|
||||||
|
|||||||
Reference in New Issue
Block a user