Fix up debugger stepping

This commit is contained in:
refractionpcsx2 2020-05-02 04:53:03 +01:00
parent 939e576df9
commit 4ce3fdfcb2
5 changed files with 24 additions and 7 deletions

View File

@ -60,7 +60,7 @@ void intBreakpoint(bool memcheck)
} }
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
GetCoreThread().PauseSelf(); GetCoreThread().PauseSelfDebug();
throw Exception::ExitCpuExecute(); throw Exception::ExitCpuExecute();
} }

View File

@ -168,6 +168,21 @@ void SysThreadBase::PauseSelf()
} }
} }
void SysThreadBase::PauseSelfDebug()
{
if (!IsSelf() || !IsRunning()) return;
{
ScopedLock locker(m_ExecModeMutex);
if (m_ExecMode == ExecMode_Opened)
m_ExecMode = ExecMode_Pausing;
OnPauseDebug();
m_sem_event.Post();
}
}
// Resumes the core execution state, or does nothing is the core is already running. If // Resumes the core execution state, or does nothing is the core is already running. If
// settings were changed, resets will be performed as needed and emulation state resumed from // settings were changed, resets will be performed as needed and emulation state resumed from
// memory savestates. // memory savestates.

View File

@ -114,6 +114,7 @@ public:
virtual void Resume(); virtual void Resume();
virtual void Pause(bool debug = false); virtual void Pause(bool debug = false);
virtual void PauseSelf(); virtual void PauseSelf();
virtual void PauseSelfDebug();
protected: protected:
virtual void OnStart(); virtual void OnStart();

View File

@ -611,6 +611,7 @@ void DisassemblyDialog::setDebugMode(bool debugMode, bool switchPC)
if (debugMode) if (debugMode)
{ {
if (!CBreakPoints::GetBreakpointTriggered())
{ {
wxBusyInfo wait("Please wait, Reading ELF functions"); wxBusyInfo wait("Please wait, Reading ELF functions");
reset(); reset();

View File

@ -1148,7 +1148,7 @@ void dynarecCheckBreakpoint()
return; return;
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
GetCoreThread().PauseSelf(); GetCoreThread().PauseSelfDebug();
recExitExecution(); recExitExecution();
} }
@ -1159,7 +1159,7 @@ void dynarecMemcheck()
return; return;
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
GetCoreThread().PauseSelf(); GetCoreThread().PauseSelfDebug();
recExitExecution(); recExitExecution();
} }