diff options
| author | skidau <skidau@gmail.com> | 2014-10-18 11:02:26 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2014-10-26 14:56:02 +1100 |
| commit | df37649b9f8499ec732b7511e7fed2b075ef7781 (patch) | |
| tree | 31af859a9afe83777a38c4cf314c9800a6a3a9f7 /Source/Core/DolphinWX/Debugger/CodeWindow.cpp | |
| parent | b331ec96a36a0c8bc70c45aa4b3c610342a734b4 (diff) | |
Changed the step over routine to a single stepping version that steps until a blr is encountered.
Cleared out all temporary breakpoints on each step to prevent phantom breakpoints from stopping the debugger.
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index f10421e860..c6ad04e8b7 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -37,6 +37,7 @@ #include "Core/Debugger/PPCDebugInterface.h" #include "Core/HW/CPU.h" #include "Core/HW/Memmap.h" +#include "Core/HW/SystemTimers.h" #include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/JitInterface.h" #include "Core/PowerPC/PowerPC.h" @@ -292,6 +293,7 @@ void CCodeWindow::SingleStep() { if (CCPU::IsStepping()) { + PowerPC::breakpoints.ClearAllTemporary(); JitInterface::InvalidateICache(PC, 4, true); CCPU::StepOpcode(&sync_event); wxThread::Sleep(20); @@ -305,6 +307,7 @@ void CCodeWindow::StepOver() { if (CCPU::IsStepping()) { + PowerPC::breakpoints.ClearAllTemporary(); UGeckoInstruction inst = Memory::Read_Instruction(PC); if (inst.LK) { @@ -328,8 +331,39 @@ void CCodeWindow::StepOut() { if (CCPU::IsStepping()) { - PowerPC::breakpoints.Add(LR, true); - CCPU::EnableStepping(false); + PowerPC::breakpoints.ClearAllTemporary(); + + // Keep stepping until the next blr or timeout after one second + u64 timeout = SystemTimers::GetTicksPerSecond(); + u64 steps = 0; + PowerPC::CoreMode oldMode = PowerPC::GetMode(); + PowerPC::SetMode(PowerPC::MODE_INTERPRETER); + UGeckoInstruction inst = Memory::Read_Instruction(PC); + GekkoOPInfo *opinfo = GetOpInfo(inst); + while (inst.hex != 0x4e800020 && steps < timeout) // check for blr + { + if (inst.LK) + { + // Step over branches + u32 next_pc = PC + 4; + while (PC != next_pc && steps < timeout) + { + PowerPC::SingleStep(); + ++steps; + } + } + else + { + PowerPC::SingleStep(); + ++steps; + } + inst = Memory::Read_Instruction(PC); + opinfo = GetOpInfo(inst); + } + + PowerPC::SingleStep(); + PowerPC::SetMode(oldMode); + JumpToAddress(PC); Update(); |
