Skip to content

Commit 80b1ee3

Browse files
committed
Debugger: SNES - Fixed deadlock when resetting the game while paused, when the "break on power/reset" option is disabled
1 parent 137ae7c commit 80b1ee3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Core/Debugger/Debugger.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ void Debugger::SleepUntilResume(CpuType sourceCpu, BreakSource source, MemoryOpe
467467
{
468468
if(_suspendRequestCount) {
469469
return;
470+
} else if(_executionStopped) {
471+
//Prevent re-entry, which can happen when OnBeforeBreak() below is called, which causes the SPC to run and can trigger a pause.
472+
//Specifically, this happens when resetting the SNES with the "Break on power/reset" option disabled.
473+
return;
470474
} else if(_breakRequestCount > 0 && (sourceCpu != _mainCpuType || !_debuggers[(int)sourceCpu].Debugger->AllowChangeProgramCounter)) {
471475
//When a break is requested by e.g a debugger call, load/save state, etc. always
472476
//break in-between 2 instructions of the main CPU, ensuring the state can be saved/loaded safely

0 commit comments

Comments
 (0)