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.
This commit is contained in:
parent
b331ec96a3
commit
df37649b9f
|
@ -113,6 +113,19 @@ void BreakPoints::Clear()
|
||||||
m_BreakPoints.clear();
|
m_BreakPoints.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BreakPoints::ClearAllTemporary()
|
||||||
|
{
|
||||||
|
for (const TBreakPoint& bp : m_BreakPoints)
|
||||||
|
{
|
||||||
|
if (bp.bTemporary)
|
||||||
|
{
|
||||||
|
if (jit)
|
||||||
|
jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4, true);
|
||||||
|
Remove(bp.iAddress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MemChecks::TMemChecksStr MemChecks::GetStrings() const
|
MemChecks::TMemChecksStr MemChecks::GetStrings() const
|
||||||
{
|
{
|
||||||
TMemChecksStr mcs;
|
TMemChecksStr mcs;
|
||||||
|
|
|
@ -67,6 +67,7 @@ public:
|
||||||
// Remove Breakpoint
|
// Remove Breakpoint
|
||||||
void Remove(u32 _iAddress);
|
void Remove(u32 _iAddress);
|
||||||
void Clear();
|
void Clear();
|
||||||
|
void ClearAllTemporary();
|
||||||
|
|
||||||
void DeleteByAddress(u32 _Address);
|
void DeleteByAddress(u32 _Address);
|
||||||
|
|
||||||
|
|
|
@ -161,6 +161,9 @@ void Init(int cpu_core)
|
||||||
state = CPU_STEPPING;
|
state = CPU_STEPPING;
|
||||||
|
|
||||||
ppcState.iCache.Init();
|
ppcState.iCache.Init();
|
||||||
|
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging)
|
||||||
|
breakpoints.ClearAllTemporary();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shutdown()
|
void Shutdown()
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include "Core/Debugger/PPCDebugInterface.h"
|
#include "Core/Debugger/PPCDebugInterface.h"
|
||||||
#include "Core/HW/CPU.h"
|
#include "Core/HW/CPU.h"
|
||||||
#include "Core/HW/Memmap.h"
|
#include "Core/HW/Memmap.h"
|
||||||
|
#include "Core/HW/SystemTimers.h"
|
||||||
#include "Core/PowerPC/Gekko.h"
|
#include "Core/PowerPC/Gekko.h"
|
||||||
#include "Core/PowerPC/JitInterface.h"
|
#include "Core/PowerPC/JitInterface.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
|
@ -292,6 +293,7 @@ void CCodeWindow::SingleStep()
|
||||||
{
|
{
|
||||||
if (CCPU::IsStepping())
|
if (CCPU::IsStepping())
|
||||||
{
|
{
|
||||||
|
PowerPC::breakpoints.ClearAllTemporary();
|
||||||
JitInterface::InvalidateICache(PC, 4, true);
|
JitInterface::InvalidateICache(PC, 4, true);
|
||||||
CCPU::StepOpcode(&sync_event);
|
CCPU::StepOpcode(&sync_event);
|
||||||
wxThread::Sleep(20);
|
wxThread::Sleep(20);
|
||||||
|
@ -305,6 +307,7 @@ void CCodeWindow::StepOver()
|
||||||
{
|
{
|
||||||
if (CCPU::IsStepping())
|
if (CCPU::IsStepping())
|
||||||
{
|
{
|
||||||
|
PowerPC::breakpoints.ClearAllTemporary();
|
||||||
UGeckoInstruction inst = Memory::Read_Instruction(PC);
|
UGeckoInstruction inst = Memory::Read_Instruction(PC);
|
||||||
if (inst.LK)
|
if (inst.LK)
|
||||||
{
|
{
|
||||||
|
@ -328,8 +331,39 @@ void CCodeWindow::StepOut()
|
||||||
{
|
{
|
||||||
if (CCPU::IsStepping())
|
if (CCPU::IsStepping())
|
||||||
{
|
{
|
||||||
PowerPC::breakpoints.Add(LR, true);
|
PowerPC::breakpoints.ClearAllTemporary();
|
||||||
CCPU::EnableStepping(false);
|
|
||||||
|
// 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);
|
JumpToAddress(PC);
|
||||||
Update();
|
Update();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue