From cbd0330c2c25bcbf0d2ae23ecf7e77a94536d6b6 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 10 Dec 2021 00:19:43 +0100 Subject: [PATCH] LazDebugger: Fix, ensure DefaultContext is available. Broken in e618b09804d62c66501488e781f82aa2b782e04c (cherry picked from commit c33019c14b0e8a4ca610968a304b2fb408e73805) --- components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas index 22bca0e73d..53cd05cba5 100644 --- a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas +++ b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas @@ -2537,14 +2537,15 @@ begin end; end; + if (CurrentThread <> nil) then + FDebugger.FDbgController.DefaultContext; // Make sure it is avail and cached / so it can be called outside the thread + // Needs to be correct thread, do not interfer with other threads if (CurrentThread = nil) or (CurrentCommand = nil) or (CurrentCommand.Thread <> CurrentThread) then exit; - FDebugger.FDbgController.DefaultContext; // Make sure it is avail and cached / so it can be called outside the thread - PC := CurrentThread.GetInstructionPointerRegisterValue; if Assigned(FBreakPoints[bplSehW64Unwound]) and FBreakPoints[bplSehW64Unwound].HasLocation(PC) then begin