From 63087a308418dfe507e353d608df100d396f0b2d Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 10 Sep 2019 18:52:46 +0000 Subject: [PATCH] FpDebug: Linux, ensure a breakpoint is reported once for each thread, if hit at the same time git-svn-id: trunk@61853 - --- components/fpdebug/fpdbglinuxclasses.pas | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/fpdebug/fpdbglinuxclasses.pas b/components/fpdebug/fpdbglinuxclasses.pas index 2d2ee4cff1..3a7d7cacfb 100644 --- a/components/fpdebug/fpdbglinuxclasses.pas +++ b/components/fpdebug/fpdbglinuxclasses.pas @@ -248,6 +248,7 @@ type FExceptionSignal: cint; FIsPaused, FInternalPauseRequested, FIsInInternalPause: boolean; FIsSteppingBreakPoint: boolean; + FDidResetInstructionPointer: Boolean; FHasThreadState: boolean; function GetDebugRegOffset(ind: byte): pointer; function ReadDebugReg(ind: byte; out AVal: PtrUInt): boolean; @@ -510,11 +511,8 @@ begin if wstopsig(AWaitedStatus) = SIGTRAP then begin ReadThreadState; CheckAndResetInstructionPointerAfterBreakpoint; + Result := True; // TODO: main loop should search all threads for breakpoints -// TODO: add to FPostponedSignals => and alert user about the breakpoint hit -// But, that needs to handle that breakpoints could be removed in the meantime.... -// Remember CheckAndResetInstructionPointerAfterBreakpoint was done - //Result := True; end else @@ -537,12 +535,16 @@ begin FIsPaused := False; FExceptionSignal := 0; FHasThreadState := False; + FDidResetInstructionPointer := False; end; function TDbgLinuxThread.ResetInstructionPointerAfterBreakpoint: boolean; begin ReadThreadState; result := true; + if FDidResetInstructionPointer then + exit; + FDidResetInstructionPointer := True; if Process.Mode=dm32 then Dec(FUserRegs.regs32[eip])