Преглед изворни кода

* use the gdb/mi command for setting breakpoint conditions in the gdb/mi interface

git-svn-id: trunk@29789 -
nickysn пре 10 година
родитељ
комит
46695f37b4
3 измењених фајлова са 21 додато и 1 уклоњено
  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

@@ -1793,7 +1793,7 @@ begin
         begin
         begin
           GDBIndex:=bkpt_no;
           GDBIndex:=bkpt_no;
           GDBState:=bs_enabled;
           GDBState:=bs_enabled;
-          Debugger^.Command('cond '+IntToStr(GDBIndex)+' '+GetStr(Conditions));
+          Debugger^.BreakpointCondition(GDBIndex, GetStr(Conditions));
           If IgnoreCount>0 then
           If IgnoreCount>0 then
             Debugger^.Command('ignore '+IntToStr(GDBIndex)+' '+IntToStr(IgnoreCount));
             Debugger^.Command('ignore '+IntToStr(GDBIndex)+' '+IntToStr(IgnoreCount));
           If Assigned(Commands) then
           If Assigned(Commands) then

+ 10 - 0
ide/gdbmicon.pas

@@ -59,6 +59,7 @@ type
     function BreakpointDelete(BkptNo: LongInt): Boolean;
     function BreakpointDelete(BkptNo: LongInt): Boolean;
     function BreakpointEnable(BkptNo: LongInt): Boolean;
     function BreakpointEnable(BkptNo: LongInt): Boolean;
     function BreakpointDisable(BkptNo: LongInt): Boolean;
     function BreakpointDisable(BkptNo: LongInt): Boolean;
+    function BreakpointCondition(BkptNo: LongInt; const ConditionExpr: string): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     procedure Backtrace;
     function LoadFile(var fn: string): Boolean;
     function LoadFile(var fn: string): Boolean;
@@ -238,6 +239,15 @@ begin
   BreakpointDisable := GDB.ResultRecord.Success;
   BreakpointDisable := GDB.ResultRecord.Success;
 end;
 end;
 
 
+function TGDBController.BreakpointCondition(BkptNo: LongInt; const ConditionExpr: string): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('-break-condition ' + BkptNoStr + ' ' + ConditionExpr);
+  BreakpointCondition := GDB.ResultRecord.Success;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
 begin
   Command('-break-insert -t ' + tbreakstring);
   Command('-break-insert -t ' + tbreakstring);

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

@@ -57,6 +57,7 @@ type
     function BreakpointDelete(BkptNo: LongInt): Boolean;
     function BreakpointDelete(BkptNo: LongInt): Boolean;
     function BreakpointEnable(BkptNo: LongInt): Boolean;
     function BreakpointEnable(BkptNo: LongInt): Boolean;
     function BreakpointDisable(BkptNo: LongInt): Boolean;
     function BreakpointDisable(BkptNo: LongInt): Boolean;
+    function BreakpointCondition(BkptNo: LongInt; const ConditionExpr: string): Boolean;
     procedure SetTBreak(tbreakstring : string);
     procedure SetTBreak(tbreakstring : string);
     procedure Backtrace;
     procedure Backtrace;
     { needed for dos because newlines are only #10 (PM) }
     { needed for dos because newlines are only #10 (PM) }
@@ -366,6 +367,15 @@ begin
   BreakpointDisable := not Error;
   BreakpointDisable := not Error;
 end;
 end;
 
 
+function TGDBController.BreakpointCondition(BkptNo: LongInt; const ConditionExpr: string): Boolean;
+var
+  BkptNoStr: string;
+begin
+  Str(BkptNo, BkptNoStr);
+  Command('condition ' + BkptNoStr + ' ' + ConditionExpr);
+  BreakpointCondition := not Error;
+end;
+
 procedure TGDBController.SetTBreak(tbreakstring : string);
 procedure TGDBController.SetTBreak(tbreakstring : string);
 begin
 begin
   Last_breakpoint_number:=0;
   Last_breakpoint_number:=0;