Browse Source

* TDebugController.SetTBreak (adds a temporary breakpoint, used for things like
'run to cursor') moved to gdbcon.pp and implemented via a GDB/MI command in
the new GDB/MI interface.

git-svn-id: trunk@29721 -

nickysn 10 years ago
parent
commit
f06731ae4f
3 changed files with 16 additions and 8 deletions
  1. 0 8
      ide/fpdebug.pas
  2. 8 0
      ide/gdbmicon.pas
  3. 8 0
      packages/gdbint/src/gdbcon.pp

+ 0 - 8
ide/fpdebug.pas

@@ -55,7 +55,6 @@ type
      HasExe   : boolean;
      RunCount : longint;
      WindowWidth : longint;
-     TBreakNumber : longint;
      FPCBreakErrorNumber : longint;
 {$ifdef SUPPORT_REMOTE}
      isRemoteDebugging,
@@ -65,7 +64,6 @@ type
 {$endif SUPPORT_REMOTE}
     constructor Init;
     procedure SetExe(const exefn:string);
-    procedure SetTBreak(tbreakstring : string);
     procedure SetWidth(AWidth : longint);
     procedure SetSourceDirs;
     destructor  Done;
@@ -711,12 +709,6 @@ begin
 end;
 
 
-procedure TDebugController.SetTBreak(tbreakstring : string);
-begin
-  Command('tbreak '+tbreakstring);
-  TBreakNumber:=Last_breakpoint_number;
-end;
-
 procedure TDebugController.SetWidth(AWidth : longint);
 begin
   WindowWidth:=AWidth;

+ 8 - 0
ide/gdbmicon.pas

@@ -27,6 +27,7 @@ uses
 type
   TGDBController = object(TGDBInterface)
   protected
+    TBreakNumber,
     start_break_number: LongInt;
     in_command: LongInt;
 
@@ -48,6 +49,7 @@ type
     procedure TraceNextI;
     procedure Continue; virtual;
     procedure UntilReturn; virtual;
+    procedure SetTBreak(tbreakstring : string);
     function LoadFile(var fn: string): Boolean;
     procedure SetDir(const s: string);
     procedure SetArgs(const s: string);
@@ -163,6 +165,12 @@ begin
   WaitForProgramStop;
 end;
 
+procedure TGDBController.SetTBreak(tbreakstring : string);
+begin
+  Command('-break-insert -t ' + tbreakstring);
+  TBreakNumber := GDB.ResultRecord.Parameters['bkpt'].AsTuple['number'].AsLongInt;
+end;
+
 function TGDBController.LoadFile(var fn: string): Boolean;
 var
   cmd: string;

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

@@ -30,6 +30,7 @@ type
     progname,
     progdir,
     progargs   : pchar;
+    TBreakNumber,
     start_break_number,
     in_command,
     init_count : longint;
@@ -48,6 +49,7 @@ type
     procedure TraceNextI;virtual;
     procedure Continue;virtual;
     procedure UntilReturn;virtual;
+    procedure SetTBreak(tbreakstring : string);
     { needed for dos because newlines are only #10 (PM) }
     procedure WriteErrorBuf;
     procedure WriteOutputBuf;
@@ -301,6 +303,12 @@ begin
   Command('finish');
 end;
 
+procedure TGDBController.SetTBreak(tbreakstring : string);
+begin
+  Command('tbreak '+tbreakstring);
+  TBreakNumber:=Last_breakpoint_number;
+end;
+
 
 procedure TGDBController.ClearSymbols;
 begin