Browse Source

* use the gdb/mi command for deleting breakpoints

git-svn-id: trunk@29787 -
nickysn 10 years ago
parent
commit
c2d659950e
3 changed files with 21 additions and 1 deletions
  1. 1 1
      ide/fpdebug.pas
  2. 10 0
      ide/gdbmicon.pas
  3. 10 0
      packages/gdbint/src/gdbcon.pp

+ 1 - 1
ide/fpdebug.pas

@@ -1856,7 +1856,7 @@ begin
 {$ifndef NODEBUG}
   If not assigned(Debugger) then Exit;
   if GDBIndex>0 then
-    Debugger^.Command('delete '+IntToStr(GDBIndex));
+    Debugger^.BreakpointDelete(GDBIndex);
   GDBIndex:=0;
   GDBState:=bs_deleted;
 {$endif NODEBUG}

+ 10 - 0
ide/gdbmicon.pas

@@ -56,6 +56,7 @@ type
     procedure UntilReturn; virtual;
     function BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
     function WatchpointInsert(const location: string; WatchpointType: TWatchpointType): LongInt;
+    function BreakpointDelete(BkptNo: LongInt): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     function LoadFile(var fn: string): Boolean;
@@ -208,6 +209,15 @@ begin
     WatchpointInsert := 0;
 end;
 
+function TGDBController.BreakpointDelete(BkptNo: LongInt): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('-break-delete ' + BkptNoStr);
+  BreakpointDelete := GDB.ResultRecord.Success;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
   Command('-break-insert -t ' + tbreakstring);

+ 10 - 0
packages/gdbint/src/gdbcon.pp

@@ -54,6 +54,7 @@ type
     procedure UntilReturn;virtual;
     function BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
     function WatchpointInsert(const location: string; WatchpointType: TWatchpointType): LongInt;
+    function BreakpointDelete(BkptNo: LongInt): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     { needed for dos because newlines are only #10 (PM) }
@@ -336,6 +337,15 @@ begin
   WatchpointInsert:=Last_breakpoint_number;
 end;
 
+function TGDBController.BreakpointDelete(BkptNo: LongInt): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('delete ' + BkptNoStr);
+  BreakpointDelete := not Error;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
   Last_breakpoint_number:=0;