From d932d747d1b1c6440bd3105a0e8d2f84a1f0742d Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Wed, 5 Aug 2026 00:03:35 +0200 Subject: [PATCH] Unlock breakpoint lock for access violation/guard page custom handlers Cleaner implementation of #40, credit to @linsmod for finding the bug --- TitanEngine/TitanEngine.Debugger.DebugLoop.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp b/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp index 9f92bd0..34e1847 100644 --- a/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp +++ b/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp @@ -1193,6 +1193,9 @@ __declspec(dllexport) void TITCALL DebugLoop() // Debuggee generated the GUARD_PAGE or ACCESS_VIOLATION exception if(DBGCode == DBG_EXCEPTION_NOT_HANDLED) { + // User callbacks may block while another thread calls an API that takes this lock. + breakpointLock.unlock(); + if(isAccessViolation) { if(DBGCustomHandler->chAccessViolation != NULL)