| 9053 | } |
| 9054 | |
| 9055 | void DebugContinueStepping (const bool bCallerWillUpdateDisplay/*=false*/) |
| 9056 | { |
| 9057 | static bool bForceSingleStepNext = false; // Allow at least one instruction to execute so we don't trigger on the same invalid opcode |
| 9058 | |
| 9059 | if (g_nDebugSkipLen > 0) |
| 9060 | { |
| 9061 | if ((regs.pc >= g_nDebugSkipStart) && (regs.pc < (g_nDebugSkipStart + g_nDebugSkipLen))) |
| 9062 | { |
| 9063 | // Enter turbo debugger mode -- UI not updated, etc. |
| 9064 | g_nDebugSteps = -1; |
| 9065 | g_nAppMode = MODE_STEPPING; |
| 9066 | } |
| 9067 | else |
| 9068 | { |
| 9069 | // Enter normal debugger mode -- UI updated every instruction, etc. |
| 9070 | g_nDebugSteps = 1; |
| 9071 | g_nAppMode = MODE_STEPPING; |
| 9072 | } |
| 9073 | } |
| 9074 | |
| 9075 | if (g_nDebugSteps) |
| 9076 | { |
| 9077 | bool bDoSingleStep = true; |
| 9078 | |
| 9079 | if (bForceSingleStepNext) |
| 9080 | { |
| 9081 | bForceSingleStepNext = false; |
| 9082 | g_bDebugBreakpointHit = BP_HIT_NONE; // Don't show 'Stop Reason' msg a 2nd time |
| 9083 | } |
| 9084 | else if (GetActiveCpu() != CPU_Z80) |
| 9085 | { |
| 9086 | if (g_hTraceFile) |
| 9087 | OutputTraceLine(); |
| 9088 | |
| 9089 | g_bDebugBreakpointHit = BP_HIT_NONE; |
| 9090 | |
| 9091 | if ( MemIsAddrCodeMemory(regs.pc) ) |
| 9092 | { |
| 9093 | const BYTE nOpcode = ReadByteFromMemory(regs.pc); |
| 9094 | |
| 9095 | // Update profiling stats |
| 9096 | int nOpmode = g_aOpcodes[ nOpcode ].nAddressMode; |
| 9097 | g_aProfileOpcodes[ nOpcode ].m_nCount++; |
| 9098 | g_aProfileOpmodes[ nOpmode ].m_nCount++; |
| 9099 | |
| 9100 | CheckBreakOpcode( nOpcode ); // Can set g_bDebugBreakpointHit |
| 9101 | } |
| 9102 | else |
| 9103 | { |
| 9104 | g_bDebugBreakpointHit = BP_HIT_PC_READ_FLOATING_BUS_OR_IO_MEM; |
| 9105 | } |
| 9106 | |
| 9107 | if (g_bDebugBreakpointHit) |
| 9108 | { |
| 9109 | bDoSingleStep = false; |
| 9110 | bForceSingleStepNext = true; // Allow next single-step (after this) to execute |
| 9111 | } |
| 9112 | } |
no test coverage detected