Fix up debugger stepping

This commit is contained in:
refractionpcsx2 2020-05-02 04:53:03 +01:00 committed by lightningterror
parent bb09753485
commit 6fc63116bf
5 changed files with 24 additions and 7 deletions

View File

@ -60,7 +60,7 @@ void intBreakpoint(bool memcheck)
}
CBreakPoints::SetBreakpointTriggered(true);
GetCoreThread().PauseSelf();
GetCoreThread().PauseSelfDebug();
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
// settings were changed, resets will be performed as needed and emulation state resumed from
// memory savestates.

View File

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

View File

@ -611,10 +611,11 @@ void DisassemblyDialog::setDebugMode(bool debugMode, bool switchPC)
if (debugMode)
{
{
wxBusyInfo wait("Please wait, Reading ELF functions");
reset();
}
if (!CBreakPoints::GetBreakpointTriggered())
{
wxBusyInfo wait("Please wait, Reading ELF functions");
reset();
}
CBreakPoints::ClearTemporaryBreakPoints();
breakRunButton->SetLabel(L"Run");

View File

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