From 50b0a3f2f637d563810bf93b8d99800c6a596fd5 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 4 Feb 2020 03:04:51 +0000 Subject: [PATCH] Debugger, GDBMI: Use force flag for exception breakpoints (at startup). Required for debugging dll. Only works if InternalExceptionBreakSetMethod = imbName git-svn-id: trunk@62610 - --- components/lazdebuggergdbmi/gdbmidebugger.pp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/components/lazdebuggergdbmi/gdbmidebugger.pp b/components/lazdebuggergdbmi/gdbmidebugger.pp index fbf4fecb9d..c628b6c1d2 100644 --- a/components/lazdebuggergdbmi/gdbmidebugger.pp +++ b/components/lazdebuggergdbmi/gdbmidebugger.pp @@ -5664,18 +5664,12 @@ begin FTheDebugger.FFpcSpecificHandlerCallFin.SetByAddrMethod := ibmAddrDirect; FTheDebugger.FFpcSpecificHandler.SetByAddrMethod := ibmAddrIndirect; // must be at first asm line -{$IFdef WITH_GDB_FORCE_EXCEPTBREAK} - FTheDebugger.FExceptionBreak.SetByAddr(Self, True); - FTheDebugger.FBreakErrorBreak.SetByAddr(Self, True); - FTheDebugger.FRunErrorBreak.SetByAddr(Self, True); -{$Else} if ieRaiseBreakPoint in DbgProp.InternalExceptionBreakPoints then FTheDebugger.FExceptionBreak.SetByAddr(Self); if ieBreakErrorBreakPoint in DbgProp.InternalExceptionBreakPoints then FTheDebugger.FBreakErrorBreak.SetByAddr(Self); if ieRunErrorBreakPoint in DbgProp.InternalExceptionBreakPoints then FTheDebugger.FRunErrorBreak.SetByAddr(Self); -{$ENDIF} if (not ((FTheDebugger.FExceptionBreak.IsBreakSet or not (ieRaiseBreakPoint in DbgProp.InternalExceptionBreakPoints)) and (FTheDebugger.FBreakErrorBreak.IsBreakSet or not (ieBreakErrorBreakPoint in DbgProp.InternalExceptionBreakPoints)) and (FTheDebugger.FRunErrorBreak.IsBreakSet or not (ieRunErrorBreakPoint in DbgProp.InternalExceptionBreakPoints)) )) and @@ -8346,11 +8340,9 @@ begin FFpcSpecificHandlerCallFin:= TGDBMIInternalBreakPoint.Create(''); FSehFinallyBreaks := TGDBMIInternalSehFinallyBreakPointList.Create; FSehCatchesBreaks := TGDBMIInternalAddrBreakPointList.Create; -{$IFdef WITH_GDB_FORCE_EXCEPTBREAK} - FBreakErrorBreak.UseForceFlag := True; - FRunErrorBreak.UseForceFlag := True; - FExceptionBreak.UseForceFlag := True; -{$ENDIF} + FBreakErrorBreak.UseForceFlag := not TGDBMIDebuggerProperties(GetProperties).DisableForcedBreakpoint; + FRunErrorBreak.UseForceFlag := not TGDBMIDebuggerProperties(GetProperties).DisableForcedBreakpoint; + FExceptionBreak.UseForceFlag := not TGDBMIDebuggerProperties(GetProperties).DisableForcedBreakpoint; FInstructionQueue := TGDBMIDbgInstructionQueue.Create(Self); FCommandQueue := TGDBMIDebuggerCommandList.Create; @@ -12643,7 +12635,9 @@ begin FBreaks[ALoc].BreakAddr := 0; FBreaks[ALoc].BreakFunction := ''; - if UseForceFlag and ACmd.FTheDebugger.CanForceBreakPoints then + if UseForceFlag and ACmd.FTheDebugger.CanForceBreakPoints and + (ABreakLoc <> '') and not(ABreakLoc[1] in ['+', '*']) + then begin if (not ACmd.ExecuteCommand('-break-insert -f %s', [ABreakLoc], R)) or (R.State = dsError)