From 7e553b0732245990c884bf9434dfc768c744f1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 29 Sep 2026 13:17:00 -0600 Subject: [PATCH] GE debugger: Lock when adding command breakpoints Debuggers add them from their own threads, racing ClearTempBreakpoints on the emu thread. Co-Authored-By: Claude Opus 5.5 (1M context) --- GPU/Debugger/Breakpoints.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GPU/Debugger/Breakpoints.cpp b/GPU/Debugger/Breakpoints.cpp index 74e05dd249..576d1ead92 100644 --- a/GPU/Debugger/Breakpoints.cpp +++ b/GPU/Debugger/Breakpoints.cpp @@ -319,6 +319,8 @@ void GPUBreakpoints::AddAddressBreakpoint(u32 addr, bool temp) { } void GPUBreakpoints::AddCmdBreakpoint(u8 cmd, bool temp) { + // Debuggers call this from their own threads, racing ClearTempBreakpoints on the emu thread. + std::lock_guard guard(breaksLock); if (temp) { if (!breakCmds[cmd]) { breakCmdsTemp[cmd] = true; @@ -374,6 +376,7 @@ void GPUBreakpoints::AddRenderTargetBreakpoint(u32 addr, bool temp) { } void GPUBreakpoints::AddTextureChangeTempBreakpoint() { + std::lock_guard guard(breaksLock); textureChangeTemp = true; hasBreakpoints_ = true; }