From 97c29d95401dde37e41bc43a2c0b45f105fd647b Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 11 Dec 2021 00:28:16 +0100 Subject: [PATCH] LazDebuggerFp: Added safety measures for single stepping (Win64 SEH) --- components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas index 6a7ee5f737..9e73e1781e 100644 --- a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas +++ b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas @@ -2750,6 +2750,8 @@ begin // bplRtlRestoreContext if assigned(FBreakPoints[bplRtlRestoreContext]) and FBreakPoints[bplRtlRestoreContext].HasLocation(PC) then begin AFinishLoopAndSendEvents := False; + AnIsFinished := False; + if (CurrentCommand <> nil) and (CurrentCommand.Thread <> CurrentThread) then exit; debugln(FPDBG_COMMANDS, ['@ bplRtlRestoreContext ', DbgSName(CurrentCommand)]); @@ -2770,6 +2772,8 @@ begin if assigned(FBreakPoints[bplRtlUnwind]) and FBreakPoints[bplRtlUnwind].HasLocation(PC) then begin debugln(FPDBG_COMMANDS, ['@ bplRtlUnwind ', DbgSName(CurrentCommand)]); AFinishLoopAndSendEvents := False; + AnIsFinished := False; + // This is Win64 bit only // Must run for any thread => the thread may stop at a break in a finally block, and then attempt to step to except // maybe store the thread-id with each breakpoint // though SP register values should be unique