From 8ed6109955a970f39ee63620430da53a2c829529 Mon Sep 17 00:00:00 2001
From: nickysn <nickysn@gmail.com>
Date: Sun, 22 Feb 2015 02:46:48 +0000
Subject: [PATCH] * setting breakpoint ignore count implemented via gdb/mi
 command in the gdb/mi   interface

git-svn-id: trunk@29790 -
---
 ide/fpdebug.pas               |  2 +-
 ide/gdbmicon.pas              | 11 +++++++++++
 packages/gdbint/src/gdbcon.pp | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/ide/fpdebug.pas b/ide/fpdebug.pas
index 71f5066f13..887869657b 100644
--- a/ide/fpdebug.pas
+++ b/ide/fpdebug.pas
@@ -1795,7 +1795,7 @@ begin
           GDBState:=bs_enabled;
           Debugger^.BreakpointCondition(GDBIndex, GetStr(Conditions));
           If IgnoreCount>0 then
-            Debugger^.Command('ignore '+IntToStr(GDBIndex)+' '+IntToStr(IgnoreCount));
+            Debugger^.BreakpointSetIgnoreCount(GDBIndex, IgnoreCount);
           If Assigned(Commands) then
             begin
               {Commands are not handled yet }
diff --git a/ide/gdbmicon.pas b/ide/gdbmicon.pas
index 903c34884b..702b31e679 100644
--- a/ide/gdbmicon.pas
+++ b/ide/gdbmicon.pas
@@ -60,6 +60,7 @@ type
     function BreakpointEnable(BkptNo: LongInt): Boolean;
     function BreakpointDisable(BkptNo: LongInt): Boolean;
     function BreakpointCondition(BkptNo: LongInt; const ConditionExpr: string): Boolean;
+    function BreakpointSetIgnoreCount(BkptNo: LongInt; const IgnoreCount: LongInt): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     function LoadFile(var fn: string): Boolean;
@@ -248,6 +249,16 @@ begin
   BreakpointCondition := GDB.ResultRecord.Success;
 end;
 
+function TGDBController.BreakpointSetIgnoreCount(BkptNo: LongInt; const IgnoreCount: LongInt): Boolean;
+var
+  BkptNoStr, IgnoreCountStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Str(IgnoreCount, IgnoreCountStr);
+  Command('-break-after ' + BkptNoStr + ' ' + IgnoreCountStr);
+  BreakpointSetIgnoreCount := GDB.ResultRecord.Success;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
   Command('-break-insert -t ' + tbreakstring);
diff --git a/packages/gdbint/src/gdbcon.pp b/packages/gdbint/src/gdbcon.pp
index 8c935e1b30..284ccc42c3 100644
--- a/packages/gdbint/src/gdbcon.pp
+++ b/packages/gdbint/src/gdbcon.pp
@@ -58,6 +58,7 @@ type
     function BreakpointEnable(BkptNo: LongInt): Boolean;
     function BreakpointDisable(BkptNo: LongInt): Boolean;
     function BreakpointCondition(BkptNo: LongInt; const ConditionExpr: string): Boolean;
+    function BreakpointSetIgnoreCount(BkptNo: LongInt; const IgnoreCount: LongInt): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     { needed for dos because newlines are only #10 (PM) }
@@ -376,6 +377,16 @@ begin
   BreakpointCondition := not Error;
 end;
 
+function TGDBController.BreakpointSetIgnoreCount(BkptNo: LongInt; const IgnoreCount: LongInt): Boolean;
+var
+  BkptNoStr, IgnoreCountStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Str(IgnoreCount, IgnoreCountStr);
+  Command('ignore ' + BkptNoStr + ' ' + IgnoreCountStr);
+  BreakpointSetIgnoreCount := not Error;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
   Last_breakpoint_number:=0;