瀏覽代碼

* use gdb/mi commands to enable/disable breakpoints in the gdb/mi interface

git-svn-id: trunk@29788 -
nickysn 10 年之前
父節點
當前提交
1bfcf14ef9
共有 3 個文件被更改,包括 42 次插入2 次删除
  1. 2 2
      ide/fpdebug.pas
  2. 20 0
      ide/gdbmicon.pas
  3. 20 0
      packages/gdbint/src/gdbcon.pp

+ 2 - 2
ide/fpdebug.pas

@@ -1867,7 +1867,7 @@ begin
 {$ifndef NODEBUG}
   If not assigned(Debugger) then Exit;
   if GDBIndex>0 then
-    Debugger^.Command('enable '+IntToStr(GDBIndex))
+    Debugger^.BreakpointEnable(GDBIndex)
   else
     Insert;
   GDBState:=bs_disabled;
@@ -1879,7 +1879,7 @@ begin
 {$ifndef NODEBUG}
   If not assigned(Debugger) then Exit;
   if GDBIndex>0 then
-    Debugger^.Command('disable '+IntToStr(GDBIndex));
+    Debugger^.BreakpointDisable(GDBIndex);
   GDBState:=bs_disabled;
 {$endif NODEBUG}
 end;

+ 20 - 0
ide/gdbmicon.pas

@@ -57,6 +57,8 @@ type
     function BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
     function WatchpointInsert(const location: string; WatchpointType: TWatchpointType): LongInt;
     function BreakpointDelete(BkptNo: LongInt): Boolean;
+    function BreakpointEnable(BkptNo: LongInt): Boolean;
+    function BreakpointDisable(BkptNo: LongInt): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     function LoadFile(var fn: string): Boolean;
@@ -218,6 +220,24 @@ begin
   BreakpointDelete := GDB.ResultRecord.Success;
 end;
 
+function TGDBController.BreakpointEnable(BkptNo: LongInt): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('-break-enable ' + BkptNoStr);
+  BreakpointEnable := GDB.ResultRecord.Success;
+end;
+
+function TGDBController.BreakpointDisable(BkptNo: LongInt): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('-break-disable ' + BkptNoStr);
+  BreakpointDisable := GDB.ResultRecord.Success;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
   Command('-break-insert -t ' + tbreakstring);

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

@@ -55,6 +55,8 @@ type
     function BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
     function WatchpointInsert(const location: string; WatchpointType: TWatchpointType): LongInt;
     function BreakpointDelete(BkptNo: LongInt): Boolean;
+    function BreakpointEnable(BkptNo: LongInt): Boolean;
+    function BreakpointDisable(BkptNo: LongInt): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     { needed for dos because newlines are only #10 (PM) }
@@ -346,6 +348,24 @@ begin
   BreakpointDelete := not Error;
 end;
 
+function TGDBController.BreakpointEnable(BkptNo: LongInt): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('enable ' + BkptNoStr);
+  BreakpointEnable := not Error;
+end;
+
+function TGDBController.BreakpointDisable(BkptNo: LongInt): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('disable ' + BkptNoStr);
+  BreakpointDisable := not Error;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
   Last_breakpoint_number:=0;