Use CPU cycles to determine if we should skip a breakpoint after resuming

This commit is contained in:
Kingcom 2014-02-25 13:18:54 +01:00
parent c8a760832b
commit 074da1fedf
4 changed files with 17 additions and 6 deletions

View File

@ -347,14 +347,15 @@ void CBreakPoints::ExecMemCheckJitCleanup()
void CBreakPoints::SetSkipFirst(u32 pc)
{
breakSkipFirstAt_ = pc & addressMask;
// breakSkipFirstTicks_ = CoreTiming::GetTicks();
breakSkipFirstTicks_ = r5900Debug.getCycles();
}
u32 CBreakPoints::CheckSkipFirst(u32 cmpPc)
{
cmpPc &= addressMask;
u32 pc = breakSkipFirstAt_;
if (pc == cmpPc)
return 1;
if (breakSkipFirstTicks_ == r5900Debug.getCycles())
return pc;
return 0;
}

View File

@ -480,6 +480,11 @@ bool R5900DebugInterface::isValidAddress(u32 addr)
}
u32 R5900DebugInterface::getCycles()
{
return cpuRegs.cycle;
}
//
// R3000DebugInterface
//
@ -701,3 +706,8 @@ bool R3000DebugInterface::isValidAddress(u32 addr)
return !(addr & 0x40000000) && vtlb_GetPhyPtr(addr & 0x1FFFFFFF) != NULL;
}
u32 R3000DebugInterface::getCycles()
{
return psxRegs.cycle;
}

View File

@ -31,6 +31,7 @@ public:
virtual std::string disasm(u32 address) = 0;
virtual bool isValidAddress(u32 address) = 0;
virtual u32 getCycles() = 0;
bool initExpression(const char* exp, PostfixExpression& dest);
bool parseExpression(PostfixExpression& exp, u64& dest);
@ -67,6 +68,7 @@ public:
virtual std::string disasm(u32 address);
virtual bool isValidAddress(u32 address);
virtual u32 getCycles();
};
@ -97,6 +99,7 @@ public:
virtual std::string disasm(u32 address);
virtual bool isValidAddress(u32 address);
virtual u32 getCycles();
};
extern R5900DebugInterface r5900Debug;

View File

@ -1272,10 +1272,7 @@ void dynarecCheckBreakpoint()
{
u32 pc = cpuRegs.pc;
if (CBreakPoints::CheckSkipFirst(pc))
{
CBreakPoints::SetSkipFirst(0xFFFFFFFF);
return;
}
auto cond = CBreakPoints::GetBreakPointCondition(pc);
if (cond && !cond->Evaluate())