From f06731ae4f49c1767e06dbcaf80d415a2b2c2881 Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 16 Feb 2015 19:58:40 +0000 Subject: [PATCH] * 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 - --- ide/fpdebug.pas | 8 -------- ide/gdbmicon.pas | 8 ++++++++ packages/gdbint/src/gdbcon.pp | 8 ++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ide/fpdebug.pas b/ide/fpdebug.pas index 5a1e6bc9aa..f46bdef12a 100644 --- a/ide/fpdebug.pas +++ b/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; diff --git a/ide/gdbmicon.pas b/ide/gdbmicon.pas index 078d881408..ca06e2b28f 100644 --- a/ide/gdbmicon.pas +++ b/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; diff --git a/packages/gdbint/src/gdbcon.pp b/packages/gdbint/src/gdbcon.pp index fb38cd3eb4..8c111e8ac0 100644 --- a/packages/gdbint/src/gdbcon.pp +++ b/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