From 011e8fcd071cb39b65a7d1de4fd976584adf050a Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 24 Mar 2015 00:27:44 +0000 Subject: [PATCH] * moved the code for setting max width and then restoring it when obtaining a backtrace from fpdebug.pas to the Backtrace method in the libgdb.a interface. - removed the code for changing the gdb window width from fpdebug.pas entirely, because it makes no sense for the gdb/mi interface and it's better to use MaxWidth/NormWidth in the libgdb.a interface for the libgdb.a functions that need it. git-svn-id: trunk@30299 - --- ide/fpdebug.pas | 13 ------------- ide/fpviews.pas | 4 +++- packages/gdbint/src/gdbcon.pp | 2 ++ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/ide/fpdebug.pas b/ide/fpdebug.pas index 3112317fbb..64d934904a 100644 --- a/ide/fpdebug.pas +++ b/ide/fpdebug.pas @@ -57,7 +57,6 @@ type NoSwitch : boolean; HasExe : boolean; RunCount : longint; - WindowWidth : longint; FPCBreakErrorNumber : longint; {$ifdef SUPPORT_REMOTE} isRemoteDebugging, @@ -67,7 +66,6 @@ type {$endif SUPPORT_REMOTE} constructor Init; procedure SetExe(const exefn:string); - procedure SetWidth(AWidth : longint); procedure SetSourceDirs; destructor Done; function DoSelectSourceline(const fn:string;line,BreakIndex:longint): Boolean;virtual; @@ -665,7 +663,6 @@ begin NoSwitch:=False; HasExe:=false; Debugger:=@self; - WindowWidth:=-1; switch_to_user:=true; GetDir(0,OrigPwd); SetCommand('print object off'); @@ -725,12 +722,6 @@ begin end; -procedure TDebugController.SetWidth(AWidth : longint); -begin - WindowWidth:=AWidth; - SetCommand('width '+inttostr(WindowWidth)); -end; - procedure TDebugController.SetSourceDirs; const {$ifdef GDBMI} @@ -3501,8 +3492,6 @@ end; DeskTop^.Lock; Clear; - if Debugger^.WindowWidth<>-1 then - Debugger^.SetCommand('width 0xffffffff'); Debugger^.Backtrace; { generate list } { all is in tframeentry } @@ -3543,8 +3532,6 @@ end; end; if Assigned(list) and (List^.Count > 0) then FocusItem(0); - if Debugger^.WindowWidth<>-1 then - Debugger^.SetCommand('width '+IntToStr(Debugger^.WindowWidth)); DeskTop^.Unlock; {$endif NODEBUG} end; diff --git a/ide/fpviews.pas b/ide/fpviews.pas index 6445d26b37..a6b2ad7c99 100644 --- a/ide/fpviews.pas +++ b/ide/fpviews.pas @@ -2495,8 +2495,10 @@ begin Editor^.AddLine(''); Insert(Editor); {$ifndef NODEBUG} + {$ifndef GDBMI} if assigned(Debugger) then - Debugger^.SetWidth(Size.X-1); + Debugger^.SetCommand('width ' + IntToStr(Size.X-1)); + {$endif GDBMI} {$endif NODEBUG} Editor^.silent:=false; Editor^.AutoRepeat:=true; diff --git a/packages/gdbint/src/gdbcon.pp b/packages/gdbint/src/gdbcon.pp index f14037269c..e16a9ba6fa 100644 --- a/packages/gdbint/src/gdbcon.pp +++ b/packages/gdbint/src/gdbcon.pp @@ -637,7 +637,9 @@ begin { forget all old frames } clear_frames; + MaxWidth; Command('backtrace'); + NormWidth; end; function TGDBController.SelectFrameCommand(level :longint) : boolean;