From 1f8dfd01e9711cece51ee7861ab73dd25e5ecc13 Mon Sep 17 00:00:00 2001 From: hsc Date: Tue, 6 Nov 2012 15:43:24 +0000 Subject: [PATCH] bochs: trace REP/REPZ/REPNZ iterations This allows single-stepping through REP/REPZ/REPNZ iterations. We mainly need this for a little more realistic timing model when, e.g., copying large memory areas with REP MOVSB. Be aware that memory-access tracing only works reliably for REPxx-prefixed instructions if Bochs was configured with --disable-repeat-speedups, as this Bochs optimization completely circumvents the usual memory access paths. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1885 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- simulators/bochs/cpu/cpu.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/simulators/bochs/cpu/cpu.cc b/simulators/bochs/cpu/cpu.cc index c47358fc..857dd9b9 100644 --- a/simulators/bochs/cpu/cpu.cc +++ b/simulators/bochs/cpu/cpu.cc @@ -241,6 +241,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat(bxInstruction_c *i, BxExecutePtr_tR } if (RCX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -260,6 +263,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat(bxInstruction_c *i, BxExecutePtr_tR } if (ECX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -278,6 +284,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat(bxInstruction_c *i, BxExecutePtr_tR } if (CX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -324,6 +333,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat_ZF(bxInstruction_c *i, BxExecutePtr } if (! get_ZF() || RCX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -343,6 +355,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat_ZF(bxInstruction_c *i, BxExecutePtr } if (! get_ZF() || ECX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -361,6 +376,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat_ZF(bxInstruction_c *i, BxExecutePtr } if (! get_ZF() || CX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -381,6 +399,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat_ZF(bxInstruction_c *i, BxExecutePtr } if (get_ZF() || RCX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -400,6 +421,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat_ZF(bxInstruction_c *i, BxExecutePtr } if (get_ZF() || ECX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif @@ -418,6 +442,9 @@ void BX_CPP_AttrRegparmN(2) BX_CPU_C::repeat_ZF(bxInstruction_c *i, BxExecutePtr } if (get_ZF() || CX == 0) return; + // DanceOS + defineCPULoopJoinPoint(BX_CPU_THIS, i); + #if BX_DEBUGGER == 0 if (BX_CPU_THIS_PTR async_event) #endif