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