From 99c6426a537c3f053b4bd5e2c9e7aed0679d829c Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Sat, 10 Jan 2026 01:57:08 +0100 Subject: [PATCH] Add workaround for slightly improved multi-thread debugging --- src/Cafe/HW/Espresso/Debugger/Debugger.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Cafe/HW/Espresso/Debugger/Debugger.cpp b/src/Cafe/HW/Espresso/Debugger/Debugger.cpp index fbfc94fe..644e1f90 100644 --- a/src/Cafe/HW/Espresso/Debugger/Debugger.cpp +++ b/src/Cafe/HW/Espresso/Debugger/Debugger.cpp @@ -543,6 +543,12 @@ void debugger_createPPCStateSnapshot(PPCInterpreter_t* hCPU) void debugger_enterTW(PPCInterpreter_t* hCPU) { + // Currently, we don't support multiple threads inside the debugger. Spin loop a thread if we already paused for another breakpoint hit. + while (debuggerState.debugSession.isTrapped) + { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + // handle logging points DebuggerBreakpoint* bp = debugger_getFirstBP(hCPU->instructionPointer); bool shouldBreak = debuggerBPChain_hasType(bp, DEBUGGER_BP_T_NORMAL) || debuggerBPChain_hasType(bp, DEBUGGER_BP_T_ONE_SHOT);