CPU: Fix crash on breakpoint add/trace enable

This commit is contained in:
Stenzek 2023-08-29 17:17:57 +10:00
parent 720b5c1e9d
commit 92b1c21b8a
3 changed files with 9 additions and 1 deletions

View file

@ -1770,7 +1770,8 @@ void UpdateDebugDispatcherFlag()
Log_DevPrintf("%s debug dispatcher", use_debug_dispatcher ? "Now using" : "No longer using");
g_state.use_debug_dispatcher = use_debug_dispatcher;
ExitExecution();
if (System::IsExecuting())
ExitExecution();
}
void ExitExecution()

View file

@ -337,6 +337,12 @@ bool System::IsValid()
return s_state == State::Running || s_state == State::Paused;
}
bool System::IsExecuting()
{
DebugAssert(IsValid());
return s_system_executing;
}
bool System::IsStartupCancelled()
{
return s_startup_cancelled.load();

View file

@ -139,6 +139,7 @@ bool IsExecutionInterrupted();
bool IsPaused();
bool IsShutdown();
bool IsValid();
bool IsExecuting();
bool IsStartupCancelled();
void CancelPendingStartup();