mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 20:00:47 +02:00
* Debugger: Try to set pending breakpoints if supported by gdb.
git-svn-id: trunk@23747 -
This commit is contained in:
parent
ab29a9ca68
commit
42bd813626
@ -84,7 +84,8 @@ type
|
||||
);
|
||||
|
||||
TGDBMIDebuggerFlags = set of (
|
||||
dfImplicidTypes // Debugger supports implicit types (^Type)
|
||||
dfImplicidTypes, // Debugger supports implicit types (^Type)
|
||||
dfForceBreak // Debugger supports insertion of not yet known brekpoints
|
||||
);
|
||||
|
||||
TGDBMIRTLCallingConvention = (ccDefault, ccRegCall, ccStdCall);
|
||||
@ -4035,7 +4036,7 @@ var
|
||||
R: TGDBMIExecResult;
|
||||
FileType, EntryPoint: String;
|
||||
List: TGDBMINameValueList;
|
||||
TargetPIDPart: String;
|
||||
TargetPIDPart, S: String;
|
||||
TempInstalled, CanContinue: Boolean;
|
||||
begin
|
||||
if not (State in [dsStop])
|
||||
@ -4130,6 +4131,17 @@ begin
|
||||
TempInstalled := R.State <> dsError;
|
||||
end;
|
||||
|
||||
// detect if we can insert a not yet known break
|
||||
ExecuteCommand('-break-insert -f foo', [cfIgnoreError], R);
|
||||
if R.State <> dsError
|
||||
then begin
|
||||
Include(FDebuggerFlags, dfForceBreak);
|
||||
List := TGDBMINameValueList.Create(R, ['bkpt']);
|
||||
ExecuteCommand('-break-delete ' + List.Values['number'], [cfIgnoreError]);
|
||||
List.Free;
|
||||
end
|
||||
else Exclude(FDebuggerFlags, dfForceBreak);
|
||||
|
||||
FTargetPID := 0;
|
||||
|
||||
// fire the first step
|
||||
@ -4249,7 +4261,11 @@ begin
|
||||
|
||||
if Debugger.State = dsRun
|
||||
then TGDBMIDebugger(Debugger).GDBPause(True);
|
||||
TGDBMIDebugger(Debugger).ExecuteCommand('-break-insert %s:%d',
|
||||
|
||||
if dfForceBreak in TGDBMIDebugger(Debugger).FDebuggerFlags
|
||||
then TGDBMIDebugger(Debugger).ExecuteCommand('-break-insert -f %s:%d',
|
||||
[ExtractFileName(Source), Line], [cfIgnoreError], @SetBreakPointCallback, 0)
|
||||
else TGDBMIDebugger(Debugger).ExecuteCommand('-break-insert %s:%d',
|
||||
[ExtractFileName(Source), Line], [cfIgnoreError], @SetBreakPointCallback, 0);
|
||||
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user