diff --git a/debugger/debugger.pp b/debugger/debugger.pp index 31480e4a42..643799796a 100644 --- a/debugger/debugger.pp +++ b/debugger/debugger.pp @@ -847,6 +847,9 @@ type //MWE: Now they do make sense ! destructor Destroy; override; + class function Caption: String; virtual; // The name of the debugger as shown in the debuggeroptions + class function ExePaths: String; virtual; // The default locations of the exe + procedure Init; virtual; // Initializes the debugger procedure Done; virtual; // Kills the debugger procedure Run; // Starts / continues debugging @@ -857,8 +860,8 @@ type procedure RunTo(const ASource: String; const ALine: Integer); virtual; // Executes til a certain point procedure JumpTo(const ASource: String; const ALine: Integer); virtual; // No execute, only set exec point - function Evaluate(const AExpression: String; var AResult: String): Boolean; // Evaluates the given expression, returns true if valid - function Modify(const AExpression, AValue: String): Boolean; // Modifies the given expression, returns true if valid + function Evaluate(const AExpression: String; var AResult: String): Boolean; // Evaluates the given expression, returns true if valid + function Modify(const AExpression, AValue: String): Boolean; // Modifies the given expression, returns true if valid function TargetIsStarted: boolean; virtual; public @@ -1002,6 +1005,11 @@ end; { TDebugger } { =========================================================================== } +function TDebugger.Caption: String; +begin + Result := 'No caption set'; +end; + function TDebugger.ChangeFileName: Boolean; begin Result := True; @@ -1122,6 +1130,11 @@ begin Result := ReqCmd(dcEvaluate, [AExpression, @AResult]); end; +function TDebugger.ExePaths: String; +begin + Result := ''; +end; + function TDebugger.GetCommands: TDBGCommands; begin Result := COMMANDMAP[State] * GetSupportedCommands; @@ -3014,6 +3027,9 @@ end; end. { ============================================================================= $Log$ + Revision 1.48 2003/07/30 23:15:39 marc + * Added RegisterDebugger + Revision 1.47 2003/07/28 18:02:06 mattias added findinfiles strat implementation from Bob Wingard diff --git a/debugger/gdbmidebugger.pp b/debugger/gdbmidebugger.pp index 11eb55ea7d..13ad962d88 100644 --- a/debugger/gdbmidebugger.pp +++ b/debugger/gdbmidebugger.pp @@ -38,7 +38,7 @@ interface uses Classes, Process, SysUtils, Dialogs, DBGUtils, Debugger, CmdLineDebugger, - GDBTypeInfo; + GDBTypeInfo, BaseDebugManager; type TGDBMIProgramInfo = record @@ -103,6 +103,8 @@ type function ParseInitialization: Boolean; virtual; function RequestCommand(const ACommand: TDBGCommand; const AParams: array of const): Boolean; override; public + class function Caption: String; override; + class function ExePaths: String; override; constructor Create(const AExternalDebugger: String); override; destructor Destroy; override; @@ -315,6 +317,11 @@ end; { TGDBMIDebugger } { =========================================================================== } +function TGDBMIDebugger.Caption: String; +begin + Result := 'GNU debugger (gdb)'; +end; + function TGDBMIDebugger.ChangeFileName: Boolean; begin FHasSymbols := True; // True until proven otherwise @@ -398,6 +405,11 @@ begin Result := ExecuteCommand(ACommand, [], ResultState, S, AFlags, ACallback); end; +function TGDBMIDebugger.ExePaths: String; +begin + Result := '/usr/bin/gdb;/usr/local/bin/gdb;/opt/fpc/gdb'; +end; + function TGDBMIDebugger.ExecuteCommand(const ACommand: String; var AResultValues: String; const AFlags: TGDBMICmdFlags): Boolean; var @@ -2007,9 +2019,15 @@ begin Result := True; end; +initialization + RegisterDebugger(TGDBMIDebugger); + end. { ============================================================================= $Log$ + Revision 1.34 2003/07/30 23:15:39 marc + * Added RegisterDebugger + Revision 1.33 2003/07/24 08:47:37 marc + Added SSHGDB debugger diff --git a/debugger/sshgdbmidebugger.pas b/debugger/sshgdbmidebugger.pas index 51e9ea2015..d608fed329 100644 --- a/debugger/sshgdbmidebugger.pas +++ b/debugger/sshgdbmidebugger.pas @@ -37,7 +37,7 @@ unit SSHGDBMIDebugger; interface uses - Classes, SysUtils, Dialogs, Controls, GDBMIDebugger, DBGUtils; + Classes, SysUtils, Dialogs, Controls, GDBMIDebugger, DBGUtils, BaseDebugManager; type TSSHGDBMIDebugger = class(TGDBMIDebugger) @@ -45,6 +45,8 @@ type protected function ParseInitialization: Boolean; override; public + class function Caption: String; override; + class function ExePaths: String; override; end; @@ -52,6 +54,16 @@ implementation { TSSHGDBMIDebugger } +function TSSHGDBMIDebugger.Caption: String; +begin + Result := 'GNU debugger through SSH (gdb)'; +end; + +function TSSHGDBMIDebugger.ExePaths: String; +begin + Result := '/usr/bin/ssh user@remote /usr/bin/gdb'; +end; + function TSSHGDBMIDebugger.ParseInitialization: Boolean; var Line, S: String; @@ -120,10 +132,16 @@ begin end; end; +initialization + RegisterDebugger(TSSHGDBMIDebugger); + end. { ============================================================================= $Log$ + Revision 1.2 2003/07/30 23:15:39 marc + * Added RegisterDebugger + Revision 1.1 2003/07/24 08:52:46 marc + Added SSHGDB debugger diff --git a/ide/basedebugmanager.pas b/ide/basedebugmanager.pas index 67609aa7ee..56f74abf97 100644 --- a/ide/basedebugmanager.pas +++ b/ide/basedebugmanager.pas @@ -45,11 +45,14 @@ uses type TBaseDebugManager = class(TComponent) private + function GetDebuggerClass(const AIndex: Integer): TDebuggerClass; protected FDestroying: boolean; + FDebugger: TDebugger; FExceptions: TIDEExceptions; FSignals: TIDESignals; FBreakPoints: TIDEBreakPoints; + function FindDebuggerClass(const Astring: String): TDebuggerClass; function GetState: TDBGState; virtual; abstract; function GetCommands: TDBGCommands; virtual; abstract; public @@ -82,9 +85,11 @@ type ): TModalResult; virtual; abstract; function DoViewBreakPointProperties(ABreakpoint: TIDEBreakPoint): TModalresult; virtual; abstract; function DoCreateWatch(const AExpression: string): TModalResult; virtual; abstract; - + + function DebuggerCount: Integer; public property Commands: TDBGCommands read GetCommands; // All current available commands of the debugger + property Debuggers[const AIndex: Integer]: TDebuggerClass read GetDebuggerClass; property Destroying: boolean read FDestroying; property State: TDBGState read GetState; // The current state of the debugger property BreakPoints: TIDEBreakPoints read FBreakpoints; @@ -92,13 +97,60 @@ type property Signals: TIDESignals read FSignals; // A list of actions for signals we know of end; +procedure RegisterDebugger(const ADebuggerClass: TDebuggerClass); + var DebugBoss: TBaseDebugManager; implementation -initialization - DebugBoss:=nil; +var + MDebuggerClasses: TStringList; +procedure RegisterDebugger(const ADebuggerClass: TDebuggerClass); +begin + MDebuggerClasses.AddObject(ADebuggerClass.ClassName, TObject(ADebuggerClass)); +end; + + +{ TBaseDebugManager } + +function TBaseDebugManager.DebuggerCount: Integer; +begin + Result := MDebuggerClasses.Count; +end; + +function TBaseDebugManager.FindDebuggerClass(const AString: String): TDebuggerClass; +var + idx: Integer; +begin + idx := MDebuggerClasses.IndexOf(AString); + if idx = -1 + then Result := nil + else Result := TDebuggerClass(MDebuggerClasses.Objects[idx]); +end; + +function TBaseDebugManager.GetDebuggerClass(const AIndex: Integer): TDebuggerClass; +begin + Result := TDebuggerClass(MDebuggerClasses.Objects[AIndex]); +end; + +initialization + DebugBoss := nil; + MDebuggerClasses := TStringList.Create; + MDebuggerClasses.Sorted := True; + MDebuggerClasses.Duplicates := dupError; + +finalization + FreeAndNil(MDebuggerClasses); + end. +{ ============================================================================= + $Log$ + Revision 1.16 2003/07/30 23:15:38 marc + * Added RegisterDebugger + +} + + diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas index 02362ac725..5c896f2cf1 100644 --- a/ide/debugmanager.pas +++ b/ide/debugmanager.pas @@ -82,7 +82,7 @@ type function DebuggerDlgGetFullFilename(Sender: TDebuggerDlg; var Filename: string; AskUserIfNotFound: boolean): TModalresult; private - FDebugger: TDebugger; + //FDebugger: TDebugger; FBreakpointsNotification: TIDEBreakPointsNotification; // When no debugger is created the IDE stores all debugger settings in its @@ -1274,11 +1274,10 @@ var ResetDialogs; end; -const - DEBUGGERCLASS: array[TDebuggerType] of TDebuggerClass = (nil, TGDBMIDebugger, TSSHGDBMIDebugger); var LaunchingCmdLine, LaunchingApplication, LaunchingParams: String; NewWorkingDir: String; + DebuggerClass: TDebuggerClass; begin WriteLN('[TDebugManager.DoInitDebugger] A'); @@ -1294,7 +1293,8 @@ begin BeginUpdateDialogs; try try - if DEBUGGERCLASS[EnvironmentOptions.DebuggerType] = nil + DebuggerClass := FindDebuggerClass(EnvironmentOptions.DebuggerClass); + if DebuggerClass = nil then begin if FDebugger <> nil then FreeDebugger; @@ -1302,9 +1302,9 @@ begin end; // check if debugger is already created with the right type - if (FDebugger <> nil) - and ( not (FDebugger is DEBUGGERCLASS[EnvironmentOptions.DebuggerType]) - or (FDebugger.ExternalDebugger <> EnvironmentOptions.DebuggerFilename) + if (FDebugger <> nil) + and (not (FDebugger is DebuggerClass) + or (FDebugger.ExternalDebugger <> EnvironmentOptions.DebuggerFilename) ) then begin // the current debugger is the wrong type -> free it @@ -1315,7 +1315,7 @@ begin if FDebugger = nil then begin SaveDebuggerItems; - FDebugger := DEBUGGERCLASS[EnvironmentOptions.DebuggerType].Create(EnvironmentOptions.DebuggerFilename); + FDebugger := DebuggerClass.Create(EnvironmentOptions.DebuggerFilename); TManagedBreakPoints(FBreakPoints).Master := FDebugger.BreakPoints; TManagedSignals(FSignals).Master := FDebugger.Signals; @@ -1435,8 +1435,8 @@ function TDebugManager.Evaluate(const AExpression: String; begin Result := (not Destroying) and (MainIDE.ToolStatus = itDebugger) - and (dcEvaluate in DebugBoss.Commands) and (FDebugger <> nil) + and (dcEvaluate in FDebugger.Commands) and FDebugger.Evaluate(AExpression, AResult) end; @@ -1547,6 +1547,9 @@ end. { ============================================================================= $Log$ + Revision 1.57 2003/07/30 23:15:38 marc + * Added RegisterDebugger + Revision 1.56 2003/07/25 17:05:58 mattias moved debugger type to the debugger options diff --git a/ide/debugoptionsfrm.lfm b/ide/debugoptionsfrm.lfm index 94a388a720..24f1deb164 100644 --- a/ide/debugoptionsfrm.lfm +++ b/ide/debugoptionsfrm.lfm @@ -8,13 +8,13 @@ object DebuggerOptionsForm: TDebuggerOptionsForm POSITION = podefaultposonly HORZSCROLLBAR.PAGE = 481 VERTSCROLLBAR.PAGE = 443 - LEFT = 511 + LEFT = 636 HEIGHT = 442 - TOP = 211 + TOP = 78 WIDTH = 480 object nbDebugOptions: TNOTEBOOK ALIGN = altop - PAGEINDEX = 0 + PAGEINDEX = 3 HEIGHT = 398 WIDTH = 480 object pgGeneral: TPAGE @@ -151,10 +151,10 @@ object DebuggerOptionsForm: TDebuggerOptionsForm end object seLimitLinecount: TSPINEDIT ENABLED = False - CLIMB_RATE = 4.1015090942382813 - MINVALUE = 4.1015090942382813 - MAXVALUE = 4.1015090942382813 - VALUE = 4.1015090942382813 + CLIMB_RATE = 7.10933840589535E-34 + MINVALUE = 7.10933840589535E-34 + MAXVALUE = 7.10933840589535E-34 + VALUE = 7.10933840589535E-34 LEFT = 28 HEIGHT = 20 TOP = 53 diff --git a/ide/debugoptionsfrm.lrs b/ide/debugoptionsfrm.lrs index 739880a618..71226d0066 100644 --- a/ide/debugoptionsfrm.lrs +++ b/ide/debugoptionsfrm.lrs @@ -5,12 +5,12 @@ LazarusResources.Add('TDebuggerOptionsForm','FORMDATA',[ +'sdialog'#7'CAPTION'#6#16'Debugger Options'#12'CLIENTHEIGHT'#3#186#1#11'CLIE' +'NTWIDTH'#3#224#1#8'ONCREATE'#7#25'DebuggerOptionsFormCREATE'#9'ONDESTROY'#7 +#26'DebuggerOptionsFormDESTROY'#8'POSITION'#7#16'podefaultposonly'#18'HORZSC' - +'ROLLBAR.PAGE'#3#225#1#18'VERTSCROLLBAR.PAGE'#3#187#1#4'LEFT'#3#255#1#6'HEIG' - +'HT'#3#186#1#3'TOP'#3#211#0#5'WIDTH'#3#224#1#0#9'TNOTEBOOK'#14'nbDebugOption' - +'s'#5'ALIGN'#7#5'altop'#9'PAGEINDEX'#2#0#6'HEIGHT'#3#142#1#5'WIDTH'#3#224#1#0 - +#5'TPAGE'#9'pgGeneral'#7'CAPTION'#6#7'General'#11'CLIENTWIDTH'#3#220#1#12'CL' - +'IENTHEIGHT'#3'p'#1#4'LEFT'#2#2#6'HEIGHT'#3'p'#1#3'TOP'#2#28#5'WIDTH'#3#220#1 - +#0#9'TGROUPBOX'#14'gbDebuggerType'#7'CAPTION'#6#22'Debugger type and path'#12 + +'ROLLBAR.PAGE'#3#225#1#18'VERTSCROLLBAR.PAGE'#3#187#1#4'LEFT'#3'|'#2#6'HEIGH' + +'T'#3#186#1#3'TOP'#2'N'#5'WIDTH'#3#224#1#0#9'TNOTEBOOK'#14'nbDebugOptions'#5 + +'ALIGN'#7#5'altop'#9'PAGEINDEX'#2#3#6'HEIGHT'#3#142#1#5'WIDTH'#3#224#1#0#5'T' + +'PAGE'#9'pgGeneral'#7'CAPTION'#6#7'General'#11'CLIENTWIDTH'#3#220#1#12'CLIEN' + +'THEIGHT'#3'p'#1#4'LEFT'#2#2#6'HEIGHT'#3'p'#1#3'TOP'#2#28#5'WIDTH'#3#220#1#0 + +#9'TGROUPBOX'#14'gbDebuggerType'#7'CAPTION'#6#22'Debugger type and path'#12 +'CLIENTHEIGHT'#2'E'#11'CLIENTWIDTH'#3#212#1#11'PARENTCTL3D'#8#8'TABORDER'#2#0 +#4'LEFT'#2#2#6'HEIGHT'#2'V'#3'TOP'#2#8#5'WIDTH'#3#216#1#0#9'TCOMBOBOX'#15'cm' +'bDebuggerType'#9'MAXLENGTH'#2#0#11'PARENTCTL3D'#8#8'TABORDER'#2#0#7'TABSTOP' @@ -40,71 +40,71 @@ LazarusResources.Add('TDebuggerOptionsForm','FORMDATA',[ +'TCHECKBOX'#17'chkLimitLinecount'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION' +#6#18'Limit linecount to'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#1#7'TABSTOP'#9#4 +'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2#29#5'WIDTH'#2'w'#0#0#9'TSPINEDIT'#16'seLi' - +'mitLinecount'#7'ENABLED'#8#10'CLIMB_RATE'#5#0#0#0#0#0#144'?'#131#1'@'#8'MIN' - +'VALUE'#5#0#0#0#0#0#144'?'#131#1'@'#8'MAXVALUE'#5#0#0#0#0#0#144'?'#131#1'@'#5 - +'VALUE'#5#0#0#0#0#0#144'?'#131#1'@'#4'LEFT'#2#28#6'HEIGHT'#2#20#3'TOP'#2'5'#5 - +'WIDTH'#2'>'#0#0#0#9'TGROUPBOX'#10'gbMessages'#7'CAPTION'#6#8'Messages'#12'C' - +'LIENTHEIGHT'#3#171#0#11'CLIENTWIDTH'#3#228#0#7'ENABLED'#8#11'PARENTCTL3D'#8 - +#8'TABORDER'#2#1#4'LEFT'#3#242#0#6'HEIGHT'#3#188#0#3'TOP'#2#8#5'WIDTH'#3#232 - +#0#0#9'TCHECKBOX'#21'chkMessagesBreakpoint'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7 - +'CAPTION'#6#10'Breakpoint'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#0#7'TABSTOP'#9#4 - +'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2#5#5'WIDTH'#3#161#0#0#0#9'TCHECKBOX'#18'ch' - +'kMessagesProcess'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#7'Process'#10 - +'DRAGCURSOR'#2#0#8'TABORDER'#2#1#7'TABSTOP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'T' - +'OP'#2#29#5'WIDTH'#3#147#0#0#0#9'TCHECKBOX'#17'chkMessagesThread'#11'ALLOWGR' - +'AYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#6'Thread'#10'DRAGCURSOR'#2#0#8'TABORDER' - +#2#2#7'TABSTOP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2'5'#5'WIDTH'#3#141#0#0#0 - +#9'TCHECKBOX'#17'chkMessagesModule'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTIO' - +'N'#6#6'Module'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#3#7'TABSTOP'#9#4'LEFT'#2#4#6 - +'HEIGHT'#2#20#3'TOP'#2'M'#5'WIDTH'#3#144#0#0#0#9'TCHECKBOX'#17'chkMessagesOu' - +'tput'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#6'Output'#10'DRAGCURSOR' - +#2#0#8'TABORDER'#2#4#7'TABSTOP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2'e'#5'W' - +'IDTH'#3#139#0#0#0#9'TCHECKBOX'#17'chkMessagesWindow'#11'ALLOWGRAYED'#9#8'AU' - +'TOSIZE'#9#7'CAPTION'#6#6'Window'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#5#7'TABST' - +'OP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2'}'#5'WIDTH'#3#146#0#0#0#9'TCHECKB' - +'OX'#20'chkMessagesInterface'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#9 - +'Interface'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#6#7'TABSTOP'#9#4'LEFT'#2#4#6'HE' - +'IGHT'#2#20#3'TOP'#3#149#0#5'WIDTH'#3#150#0#0#0#0#0#5'TPAGE'#12'pgExceptions' - ,#7'CAPTION'#6#19'Language Exceptions'#11'CLIENTWIDTH'#3#220#1#12'CLIENTHEIGH' - +'T'#3'p'#1#4'LEFT'#2#2#6'HEIGHT'#3'p'#1#3'TOP'#2#28#5'WIDTH'#3#220#1#0#9'TGR' - +'OUPBOX'#18'bgIgnoreExceptions'#7'CAPTION'#6#23'Ignore these exceptions'#12 - +'CLIENTHEIGHT'#3'7'#1#11'CLIENTWIDTH'#3#208#1#11'PARENTCTL3D'#8#8'TABORDER'#2 - +#0#4'LEFT'#2#4#6'HEIGHT'#3'H'#1#3'TOP'#2#8#5'WIDTH'#3#212#1#0#7'TBUTTON'#18 - +'cmdExceptionRemove'#7'ENABLED'#8#7'CAPTION'#6#6'Remove'#7'TABSTOP'#9#8'TABO' - +'RDER'#2#0#7'ONCLICK'#7#23'cmdExceptionRemoveCLICK'#4'LEFT'#3'|'#1#6'HEIGHT' - +#2#25#3'TOP'#3#21#1#5'WIDTH'#2'K'#0#0#7'TBUTTON'#15'cmdExceptionAdd'#7'CAPTI' - +'ON'#6#3'Add'#7'TABSTOP'#9#8'TABORDER'#2#1#7'ONCLICK'#7#20'cmdExceptionAddCL' - +'ICK'#4'LEFT'#3','#1#6'HEIGHT'#2#25#3'TOP'#3#21#1#5'WIDTH'#2'K'#0#0#13'TCHEC' - +'KLISTBOX'#13'clbExceptions'#7'ONCLICK'#7#18'clbExceptionsCLICK'#8'TABORDER' - +#2#2#7'TABSTOP'#9#8'TOPINDEX'#2#255#4'LEFT'#2#8#6'HEIGHT'#3#8#1#3'TOP'#2#5#5 - +'WIDTH'#3#192#1#0#0#0#9'TCHECKBOX'#19'chkBreakOnException'#11'ALLOWGRAYED'#9 - +#8'AUTOSIZE'#9#7'CAPTION'#6#27'Break on Lazarus Exceptions'#10'DRAGCURSOR'#2 - +#0#8'TABORDER'#2#1#7'TABSTOP'#9#4'LEFT'#2#2#6'HEIGHT'#2#20#3'TOP'#3'T'#1#5'W' - +'IDTH'#3#188#0#0#0#0#5'TPAGE'#9'pgSignals'#7'CAPTION'#6#13'OS Exceptions'#11 - +'CLIENTWIDTH'#3#220#1#12'CLIENTHEIGHT'#3'p'#1#4'LEFT'#2#2#6'HEIGHT'#3'p'#1#3 - +'TOP'#2#28#5'WIDTH'#3#220#1#0#9'TGROUPBOX'#9'gbSignals'#7'CAPTION'#6#7'Signa' - +'ls'#12'CLIENTHEIGHT'#3'Q'#1#11'CLIENTWIDTH'#3#208#1#11'PARENTCTL3D'#8#8'TAB' - +'ORDER'#2#0#4'LEFT'#2#4#6'HEIGHT'#3'b'#1#3'TOP'#2#8#5'WIDTH'#3#212#1#0#7'TBU' - +'TTON'#15'cmdSignalRemove'#7'ENABLED'#8#7'CAPTION'#6#6'Remove'#7'TABSTOP'#9#8 - +'TABORDER'#2#0#4'LEFT'#3'}'#1#6'HEIGHT'#2#25#3'TOP'#3'1'#1#5'WIDTH'#2'K'#0#0 - +#7'TBUTTON'#12'cmdSignalAdd'#7'CAPTION'#6#3'Add'#7'TABSTOP'#9#8'TABORDER'#2#1 - +#4'LEFT'#3'('#1#6'HEIGHT'#2#25#3'TOP'#3'1'#1#5'WIDTH'#2'K'#0#0#9'TLISTVIEW'#9 - +'lvSignals'#7'COLUMNS'#14#1#7'CAPTION'#6#4'Name'#7'VISIBLE'#9#5'WIDTH'#3#200 - +#0#0#1#7'CAPTION'#6#2'ID'#7'VISIBLE'#9#5'WIDTH'#2'2'#0#1#7'CAPTION'#6#10'Han' - +'dled by'#7'VISIBLE'#9#5'WIDTH'#2'K'#0#1#7'CAPTION'#6#6'Resume'#7'VISIBLE'#9 - +#5'WIDTH'#2'K'#0#0#9'POPUPMENU'#7#9'popSignal'#9'VIEWSTYLE'#7#8'vsreport'#4 - +'LEFT'#2#8#6'HEIGHT'#3'$'#1#3'TOP'#2#5#5'WIDTH'#3#192#1#0#0#0#0#0#7'TBUTTON' - +#9'cmdCancel'#11'MODALRESULT'#2#2#6'CANCEL'#9#7'CAPTION'#6#6'Cancel'#7'TABST' - +'OP'#9#8'TABORDER'#2#1#4'LEFT'#3#144#1#6'HEIGHT'#2#25#3'TOP'#3#152#1#5'WIDTH' - +#2'K'#0#0#7'TBUTTON'#5'cmdOK'#7'DEFAULT'#9#7'CAPTION'#6#2'OK'#7'TABSTOP'#9#8 - +'TABORDER'#2#2#7'ONCLICK'#7#10'cmdOKCLICK'#4'LEFT'#3'@'#1#6'HEIGHT'#2#25#3'T' - +'OP'#3#152#1#5'WIDTH'#2'K'#0#0#10'TPOPUPMENU'#9'popSignal'#4'left'#3#152#1#3 - +'top'#2#20#0#9'TMENUITEM'#19'mnuHandledByProgram'#9'AUTOCHECK'#9#7'CAPTION'#6 - +#18'Handled by Program'#10'GROUPINDEX'#2#1#9'RADIOITEM'#9#0#0#9'TMENUITEM'#21 - +'mnuiHandledByDebugger'#9'AUTOCHECK'#9#7'CAPTION'#6#19'Handled by Debugger' - +#10'GROUPINDEX'#2#1#9'RADIOITEM'#9#0#0#9'TMENUITEM'#2'N1'#7'CAPTION'#6#1'-'#0 - +#0#9'TMENUITEM'#16'mnuResumeHandled'#9'AUTOCHECK'#9#7'CAPTION'#6#14'Resume H' - +'andled'#10'GROUPINDEX'#2#2#9'RADIOITEM'#9#0#0#9'TMENUITEM'#18'mnuResumeUnha' - +'ndled'#9'AUTOCHECK'#9#7'CAPTION'#6#16'Resume Unhandled'#10'GROUPINDEX'#2#2#9 - +'RADIOITEM'#9#0#0#0#0 + +'mitLinecount'#7'ENABLED'#8#10'CLIMB_RATE'#5#0#0#0#0#0#144'?'#236#144'?'#8'M' + +'INVALUE'#5#0#0#0#0#0#144'?'#236#144'?'#8'MAXVALUE'#5#0#0#0#0#0#144'?'#236 + +#144'?'#5'VALUE'#5#0#0#0#0#0#144'?'#236#144'?'#4'LEFT'#2#28#6'HEIGHT'#2#20#3 + +'TOP'#2'5'#5'WIDTH'#2'>'#0#0#0#9'TGROUPBOX'#10'gbMessages'#7'CAPTION'#6#8'Me' + +'ssages'#12'CLIENTHEIGHT'#3#171#0#11'CLIENTWIDTH'#3#228#0#7'ENABLED'#8#11'PA' + +'RENTCTL3D'#8#8'TABORDER'#2#1#4'LEFT'#3#242#0#6'HEIGHT'#3#188#0#3'TOP'#2#8#5 + +'WIDTH'#3#232#0#0#9'TCHECKBOX'#21'chkMessagesBreakpoint'#11'ALLOWGRAYED'#9#8 + +'AUTOSIZE'#9#7'CAPTION'#6#10'Breakpoint'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#0#7 + +'TABSTOP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2#5#5'WIDTH'#3#161#0#0#0#9'TCH' + +'ECKBOX'#18'chkMessagesProcess'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6 + +#7'Process'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#1#7'TABSTOP'#9#4'LEFT'#2#4#6'HE' + +'IGHT'#2#20#3'TOP'#2#29#5'WIDTH'#3#147#0#0#0#9'TCHECKBOX'#17'chkMessagesThre' + +'ad'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#6'Thread'#10'DRAGCURSOR'#2 + +#0#8'TABORDER'#2#2#7'TABSTOP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2'5'#5'WID' + +'TH'#3#141#0#0#0#9'TCHECKBOX'#17'chkMessagesModule'#11'ALLOWGRAYED'#9#8'AUTO' + +'SIZE'#9#7'CAPTION'#6#6'Module'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#3#7'TABSTOP' + +#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2'M'#5'WIDTH'#3#144#0#0#0#9'TCHECKBOX' + +#17'chkMessagesOutput'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#6'Output' + +#10'DRAGCURSOR'#2#0#8'TABORDER'#2#4#7'TABSTOP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3 + +'TOP'#2'e'#5'WIDTH'#3#139#0#0#0#9'TCHECKBOX'#17'chkMessagesWindow'#11'ALLOWG' + +'RAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#6'Window'#10'DRAGCURSOR'#2#0#8'TABORDER' + +#2#5#7'TABSTOP'#9#4'LEFT'#2#4#6'HEIGHT'#2#20#3'TOP'#2'}'#5'WIDTH'#3#146#0#0#0 + +#9'TCHECKBOX'#20'chkMessagesInterface'#11'ALLOWGRAYED'#9#8'AUTOSIZE'#9#7'CAP' + +'TION'#6#9'Interface'#10'DRAGCURSOR'#2#0#8'TABORDER'#2#6#7'TABSTOP'#9#4'LEFT' + +#2#4#6'HEIGHT'#2#20#3'TOP'#3#149#0#5'WIDTH'#3#150#0#0#0#0#0#5'TPAGE'#12'pgEx' + ,'ceptions'#7'CAPTION'#6#19'Language Exceptions'#11'CLIENTWIDTH'#3#220#1#12'C' + +'LIENTHEIGHT'#3'p'#1#4'LEFT'#2#2#6'HEIGHT'#3'p'#1#3'TOP'#2#28#5'WIDTH'#3#220 + +#1#0#9'TGROUPBOX'#18'bgIgnoreExceptions'#7'CAPTION'#6#23'Ignore these except' + +'ions'#12'CLIENTHEIGHT'#3'7'#1#11'CLIENTWIDTH'#3#208#1#11'PARENTCTL3D'#8#8'T' + +'ABORDER'#2#0#4'LEFT'#2#4#6'HEIGHT'#3'H'#1#3'TOP'#2#8#5'WIDTH'#3#212#1#0#7'T' + +'BUTTON'#18'cmdExceptionRemove'#7'ENABLED'#8#7'CAPTION'#6#6'Remove'#7'TABSTO' + +'P'#9#8'TABORDER'#2#0#7'ONCLICK'#7#23'cmdExceptionRemoveCLICK'#4'LEFT'#3'|'#1 + +#6'HEIGHT'#2#25#3'TOP'#3#21#1#5'WIDTH'#2'K'#0#0#7'TBUTTON'#15'cmdExceptionAd' + +'d'#7'CAPTION'#6#3'Add'#7'TABSTOP'#9#8'TABORDER'#2#1#7'ONCLICK'#7#20'cmdExce' + +'ptionAddCLICK'#4'LEFT'#3','#1#6'HEIGHT'#2#25#3'TOP'#3#21#1#5'WIDTH'#2'K'#0#0 + +#13'TCHECKLISTBOX'#13'clbExceptions'#7'ONCLICK'#7#18'clbExceptionsCLICK'#8'T' + +'ABORDER'#2#2#7'TABSTOP'#9#8'TOPINDEX'#2#255#4'LEFT'#2#8#6'HEIGHT'#3#8#1#3'T' + +'OP'#2#5#5'WIDTH'#3#192#1#0#0#0#9'TCHECKBOX'#19'chkBreakOnException'#11'ALLO' + +'WGRAYED'#9#8'AUTOSIZE'#9#7'CAPTION'#6#27'Break on Lazarus Exceptions'#10'DR' + +'AGCURSOR'#2#0#8'TABORDER'#2#1#7'TABSTOP'#9#4'LEFT'#2#2#6'HEIGHT'#2#20#3'TOP' + +#3'T'#1#5'WIDTH'#3#188#0#0#0#0#5'TPAGE'#9'pgSignals'#7'CAPTION'#6#13'OS Exce' + +'ptions'#11'CLIENTWIDTH'#3#220#1#12'CLIENTHEIGHT'#3'p'#1#4'LEFT'#2#2#6'HEIGH' + +'T'#3'p'#1#3'TOP'#2#28#5'WIDTH'#3#220#1#0#9'TGROUPBOX'#9'gbSignals'#7'CAPTIO' + +'N'#6#7'Signals'#12'CLIENTHEIGHT'#3'Q'#1#11'CLIENTWIDTH'#3#208#1#11'PARENTCT' + +'L3D'#8#8'TABORDER'#2#0#4'LEFT'#2#4#6'HEIGHT'#3'b'#1#3'TOP'#2#8#5'WIDTH'#3 + +#212#1#0#7'TBUTTON'#15'cmdSignalRemove'#7'ENABLED'#8#7'CAPTION'#6#6'Remove'#7 + +'TABSTOP'#9#8'TABORDER'#2#0#4'LEFT'#3'}'#1#6'HEIGHT'#2#25#3'TOP'#3'1'#1#5'WI' + +'DTH'#2'K'#0#0#7'TBUTTON'#12'cmdSignalAdd'#7'CAPTION'#6#3'Add'#7'TABSTOP'#9#8 + +'TABORDER'#2#1#4'LEFT'#3'('#1#6'HEIGHT'#2#25#3'TOP'#3'1'#1#5'WIDTH'#2'K'#0#0 + +#9'TLISTVIEW'#9'lvSignals'#7'COLUMNS'#14#1#7'CAPTION'#6#4'Name'#7'VISIBLE'#9 + +#5'WIDTH'#3#200#0#0#1#7'CAPTION'#6#2'ID'#7'VISIBLE'#9#5'WIDTH'#2'2'#0#1#7'CA' + +'PTION'#6#10'Handled by'#7'VISIBLE'#9#5'WIDTH'#2'K'#0#1#7'CAPTION'#6#6'Resum' + +'e'#7'VISIBLE'#9#5'WIDTH'#2'K'#0#0#9'POPUPMENU'#7#9'popSignal'#9'VIEWSTYLE'#7 + +#8'vsreport'#4'LEFT'#2#8#6'HEIGHT'#3'$'#1#3'TOP'#2#5#5'WIDTH'#3#192#1#0#0#0#0 + +#0#7'TBUTTON'#9'cmdCancel'#11'MODALRESULT'#2#2#6'CANCEL'#9#7'CAPTION'#6#6'Ca' + +'ncel'#7'TABSTOP'#9#8'TABORDER'#2#1#4'LEFT'#3#144#1#6'HEIGHT'#2#25#3'TOP'#3 + +#152#1#5'WIDTH'#2'K'#0#0#7'TBUTTON'#5'cmdOK'#7'DEFAULT'#9#7'CAPTION'#6#2'OK' + +#7'TABSTOP'#9#8'TABORDER'#2#2#7'ONCLICK'#7#10'cmdOKCLICK'#4'LEFT'#3'@'#1#6'H' + +'EIGHT'#2#25#3'TOP'#3#152#1#5'WIDTH'#2'K'#0#0#10'TPOPUPMENU'#9'popSignal'#4 + +'left'#3#152#1#3'top'#2#20#0#9'TMENUITEM'#19'mnuHandledByProgram'#9'AUTOCHEC' + +'K'#9#7'CAPTION'#6#18'Handled by Program'#10'GROUPINDEX'#2#1#9'RADIOITEM'#9#0 + +#0#9'TMENUITEM'#21'mnuiHandledByDebugger'#9'AUTOCHECK'#9#7'CAPTION'#6#19'Han' + +'dled by Debugger'#10'GROUPINDEX'#2#1#9'RADIOITEM'#9#0#0#9'TMENUITEM'#2'N1'#7 + +'CAPTION'#6#1'-'#0#0#9'TMENUITEM'#16'mnuResumeHandled'#9'AUTOCHECK'#9#7'CAPT' + +'ION'#6#14'Resume Handled'#10'GROUPINDEX'#2#2#9'RADIOITEM'#9#0#0#9'TMENUITEM' + +#18'mnuResumeUnhandled'#9'AUTOCHECK'#9#7'CAPTION'#6#16'Resume Unhandled'#10 + +'GROUPINDEX'#2#2#9'RADIOITEM'#9#0#0#0#0 ]); diff --git a/ide/debugoptionsfrm.pas b/ide/debugoptionsfrm.pas index c93d4b6afe..b61d3e235f 100644 --- a/ide/debugoptionsfrm.pas +++ b/ide/debugoptionsfrm.pas @@ -8,7 +8,7 @@ uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls, Menus, Spin, CheckLst, LazarusIDEStrConsts, FileProcs, InputHistory, EnvironmentOpts, - BaseDebugManager, Debugger; + BaseDebugManager, Debugger, DBGUtils; type TDebuggerOptionsForm = class (TForm ) @@ -66,11 +66,13 @@ type FExceptionDeleteList: TStringList; FOldDebuggerPathAndParams: string; FDebuggerSpecificComponents: TList; - FCurDebuggerType: TDebuggerType; // currently shown debugger type + FCurDebuggerClass: TDebuggerClass; // currently shown debugger class procedure AddExceptionLine(const AException: TIDEException; AName: String); procedure AddSignalLine(const ASignal: TIDESignal); - procedure FetchDebuggerType; + procedure FetchDebuggerClass; procedure FetchDebuggerSpecificOptions; + function GetDebuggerClass: TDebuggerClass; + procedure SetDebuggerClass(const AClass: TDebuggerClass); public end; @@ -110,42 +112,58 @@ begin Item.Data := ASignal; end; -procedure TDebuggerOptionsForm.FetchDebuggerType; +procedure TDebuggerOptionsForm.FetchDebuggerClass; var - ADebuggerType: TDebuggerType; - DebuggerType: TDebuggerType; + n: Integer; + AClass: TDebuggerClass; + S: String; begin - with cmbDebuggerType.Items do begin + with cmbDebuggerType.Items do + begin BeginUpdate; Clear; - for ADebuggerType:=Low(TDebuggerType) to High(TDebuggerType) do - Add(DebuggerName[ADebuggerType]); + AddObject('(none)', TObject(-1)); // temporary manual coded + for n := 0 to DebugBoss.DebuggerCount - 1 do + begin + AClass := DebugBoss.Debuggers[n]; + AddObject(AClass.Caption, TObject(n)); + if (FCurDebuggerClass = nil) + and (CompareText(AClass.ClassName, EnvironmentOptions.DebuggerClass) = 0) + then SetDebuggerClass(AClass); + end; EndUpdate; end; + if FCurDebuggerClass = nil + then SetComboBoxText(cmbDebuggerType, '(none)') + else SetComboBoxText(cmbDebuggerType, FCurDebuggerClass.Caption); + with cmbDebuggerPath.Items do begin BeginUpdate; Assign(EnvironmentOptions.DebuggerFileHistory); - if Count=0 then - Add('/usr/bin/gdb'); + if (Count = 0) + and (FCurDebuggerClass <> nil) + then begin + S := FCurDebuggerClass.ExePaths; + while S <> '' do + begin + Add(GetPart([], [';'], S)); + if S <> '' then System.Delete(S, 1, 1); + end; + end; EndUpdate; end; FOldDebuggerPathAndParams:=EnvironmentOptions.DebuggerFilename; SetComboBoxText(cmbDebuggerPath,FOldDebuggerPathAndParams,20); - DebuggerType:=EnvironmentOptions.DebuggerType; - SetComboBoxText(cmbDebuggerType,DebuggerName[DebuggerType]); end; procedure TDebuggerOptionsForm.FetchDebuggerSpecificOptions; var - NewDebuggerType: TDebuggerType; + DebuggerClass: TDebuggerClass; i: Integer; AMemo: TMemo; begin - NewDebuggerType:=DebuggerNameToType(cmbDebuggerType.Text); - if NewDebuggerType=FCurDebuggerType then exit; - // clear debugger specific options components if FDebuggerSpecificComponents=nil then FDebuggerSpecificComponents:=TList.Create; @@ -153,45 +171,59 @@ begin TComponent(FDebuggerSpecificComponents[i]).Free; FDebuggerSpecificComponents.Clear; - // create debugger specific options components - case NewDebuggerType of - - dtNone: ; - - dtGnuDebugger: - begin + if FCurDebuggerClass = nil then Exit; - end; - - dtSSHGNUDebugger: + // create debugger specific options components + // tmep hack + if FCurDebuggerClass.ClassName = 'TSSHGDBMIDEBUGGER' + then begin + AMemo:=TMemo.Create(Self); + FDebuggerSpecificComponents.Add(AMemo); + with AMemo do begin - AMemo:=TMemo.Create(Self); - FDebuggerSpecificComponents.Add(AMemo); - with AMemo do begin - Name:='DebOptsSpecMemo1'; - Parent:=gbDebuggerSpecific; - SetBounds(5,5,Parent.Width-15,Parent.Height-35); - WordWrap:=true; - ReadOnly:=true; - Caption:='The GNU debugger through ssh allows to remote debug via a ssh' - +' connection. See docs/RemoteDebugging.txt for details. The path' - +' must contain the ssh client filename, the hostname with an optional' - +' username and the filename of gdb on the remote computer.' - +' For example: "/usr/bin/ssh username@hostname gdb"'; - end; + Name:='DebOptsSpecMemo1'; + Parent:=gbDebuggerSpecific; + SetBounds(5,5,Parent.Width-15,Parent.Height-35); + WordWrap:=true; + ReadOnly:=true; + Caption:='The GNU debugger through ssh allows to remote debug via a ssh' + +' connection. See docs/RemoteDebugging.txt for details. The path' + +' must contain the ssh client filename, the hostname with an optional' + +' username and the filename of gdb on the remote computer.' + +' For example: "/usr/bin/ssh username@hostname gdb"'; end; - end; end; +function TDebuggerOptionsForm.GetDebuggerClass: TDebuggerClass; +var + idx: Integer; +begin + Result := nil; + + idx := cmbDebuggerType.ItemIndex; + if idx = -1 then Exit; + idx := Integer(cmbDebuggerType.Items.Objects[idx]); + + if idx = -1 then Exit; + Result := DebugBoss.Debuggers[idx]; +end; + +procedure TDebuggerOptionsForm.SetDebuggerClass(const AClass: TDebuggerClass); +begin + if FCurDebuggerClass = AClass then Exit; + FCurDebuggerClass := AClass; + FetchDebuggerSpecificOptions; +end; + procedure TDebuggerOptionsForm.clbExceptionsCLICK (Sender: TObject ); begin - cmdExceptionRemove.Enabled := clbExceptions.ItemIndex <> -1; + cmdExceptionRemove.Enabled := clbExceptions.ItemIndex <> -1; end; procedure TDebuggerOptionsForm.cmbDebuggerTypeCHANGE(Sender: TObject); begin - FetchDebuggerSpecificOptions; + SetDebuggerClass(GetDebuggerClass); end; procedure TDebuggerOptionsForm.cmdExceptionAddCLICK(Sender: TObject); @@ -264,7 +296,9 @@ begin EnvironmentOptions.DebuggerFilename:=cmbDebuggerPath.Text; EnvironmentOptions.DebuggerFileHistory.Assign(cmbDebuggerPath.Items); - EnvironmentOptions.DebuggerType:=DebuggerNameToType(cmbDebuggerType.Text); + if FCurDebuggerClass = nil + then EnvironmentOptions.DebuggerClass := '' + else EnvironmentOptions.DebuggerClass := FCurDebuggerClass.ClassName; ModalResult:=mrOk; end; @@ -297,7 +331,7 @@ procedure TDebuggerOptionsForm.DebuggerOptionsFormCREATE(Sender: TObject); var n: Integer; begin - FCurDebuggerType:=dtNone; + FCurDebuggerClass := nil; FExceptionDeleteList := TStringList.Create; FExceptionDeleteList.Sorted := True; @@ -312,7 +346,10 @@ begin AddSignalLine(DebugBoss.Signals[n]); end; - FetchDebuggerType; + FetchDebuggerClass; + + // Fix designtime changes + nbDebugOptions.PageIndex := 0; end; procedure TDebuggerOptionsForm.DebuggerOptionsFormDESTROY(Sender: TObject); diff --git a/ide/environmentopts.pp b/ide/environmentopts.pp index fc1f256839..9b1279260a 100644 --- a/ide/environmentopts.pp +++ b/ide/environmentopts.pp @@ -183,9 +183,12 @@ type FCompilerFileHistory: TStringList; FFPCSourceDirectory: string; FFPCSourceDirHistory: TStringList; - FDebuggerFilename: string; - FDebuggerFileHistory: TStringList; - FDebuggerType: TDebuggerType; + // TODO: store per debuggerclass options + // Maybe these should go to a new TDebuggerOptions class + FDebuggerClass: string; + FDebuggerFilename: string; // per debugger class + FDebuggerFileHistory: TStringList; // per debugger class + FDebuggerType: TDebuggerType; // obsolete FTestBuildDirectory: string; FTestBuildDirHistory: TStringList; @@ -216,6 +219,7 @@ type procedure SetCompilerFilename(const AValue: string); procedure SetDebuggerFilename(const AValue: string); + procedure SetDebuggerType (const AValue: TDebuggerType ); procedure SetFPCSourceDirectory(const AValue: string); procedure SetLazarusDirectory(const AValue: string); procedure SetOnApplyWindowLayout(const AValue: TOnApplyIDEWindowLayout); @@ -310,11 +314,13 @@ type write SetFPCSourceDirectory; property FPCSourceDirHistory: TStringList read FFPCSourceDirHistory write FFPCSourceDirHistory; + property DebuggerClass: String read FDebuggerClass write FDebuggerClass; property DebuggerFilename: string read FDebuggerFilename write SetDebuggerFilename; property DebuggerFileHistory: TStringList read FDebuggerFileHistory write FDebuggerFileHistory; - property DebuggerType: TDebuggerType read FDebuggerType write FDebuggerType; + property DebuggerType: TDebuggerType read FDebuggerType + write SetDebuggerType; property TestBuildDirectory: string read FTestBuildDirectory write SetTestBuildDirectory; property TestBuildDirHistory: TStringList read FTestBuildDirHistory @@ -1021,17 +1027,7 @@ begin if FFPCSourceDirHistory.Count=0 then begin end; - DebuggerFilename:=XMLConfig.GetValue( - 'EnvironmentOptions/DebuggerFilename/Value',FDebuggerFilename); - LoadRecentList(XMLConfig,FDebuggerFileHistory, - 'EnvironmentOptions/DebuggerFilename/History/'); - if FDebuggerFileHistory.Count=0 then begin - FDebuggerFileHistory.Add(DebuggerName[dtNone]); - FDebuggerFileHistory.Add('/usr/bin/gdb'); - FDebuggerFileHistory.Add('/opt/fpc/gdb'); - FDebuggerFileHistory.Add('/usr/bin/ssh user@hostname gdb'); - end; - LoadDebuggerType(FDebuggerType,'EnvironmentOptions/'); + TestBuildDirectory:=XMLConfig.GetValue( 'EnvironmentOptions/TestBuildDirectory/Value',FTestBuildDirectory); LoadRecentList(XMLConfig,FTestBuildDirHistory, @@ -1051,6 +1047,27 @@ begin ,'EnvironmentOptions/BackupProjectFiles/'); LoadBackupInfo(FBackupInfoOtherFiles ,'EnvironmentOptions/BackupOtherFiles/'); + + // Debugger + // first try to load the old type + // it will be overwritten by Class if found + DebuggerType := DebuggerNameToType(XMLConfig.GetValue( + 'EnvironmentOptions/Debugger/Type','')); + DebuggerClass := XMLConfig.GetValue( + 'EnvironmentOptions/Debugger/Class',FDebuggerClass); + DebuggerFilename:=XMLConfig.GetValue( + 'EnvironmentOptions/DebuggerFilename/Value',FDebuggerFilename); + LoadRecentList(XMLConfig,FDebuggerFileHistory, + 'EnvironmentOptions/DebuggerFilename/History/'); +(* + // Don't add them here, it's done in the dialog + if FDebuggerFileHistory.Count=0 then begin + FDebuggerFileHistory.Add(DebuggerName[dtNone]); + FDebuggerFileHistory.Add('/usr/bin/gdb'); + FDebuggerFileHistory.Add('/opt/fpc/gdb'); + FDebuggerFileHistory.Add('/usr/bin/ssh user@hostname gdb'); + end; +*) end; // hints @@ -1217,11 +1234,6 @@ begin 'EnvironmentOptions/FPCSourceDirectory/Value',FFPCSourceDirectory); SaveRecentList(XMLConfig,FFPCSourceDirHistory, 'EnvironmentOptions/FPCSourceDirectory/History/'); - XMLConfig.SetValue( - 'EnvironmentOptions/DebuggerFilename/Value',FDebuggerFilename); - SaveRecentList(XMLConfig,FDebuggerFileHistory, - 'EnvironmentOptions/DebuggerFilename/History/'); - SaveDebuggerType(DebuggerType,'EnvironmentOptions/'); XMLConfig.SetValue( 'EnvironmentOptions/TestBuildDirectory/Value',FTestBuildDirectory); SaveRecentList(XMLConfig,FTestBuildDirHistory, @@ -1232,6 +1244,16 @@ begin ,'EnvironmentOptions/BackupProjectFiles/'); SaveBackupInfo(FBackupInfoOtherFiles ,'EnvironmentOptions/BackupOtherFiles/'); + + // debugger + XMLConfig.SetValue('EnvironmentOptions/Debugger/Class', FDebuggerClass); + XMLConfig.SetValue( + 'EnvironmentOptions/DebuggerFilename/Value',FDebuggerFilename); + SaveRecentList(XMLConfig,FDebuggerFileHistory, + 'EnvironmentOptions/DebuggerFilename/History/'); + //TODO: remove when registerdebugger is operational + // SaveDebuggerType(DebuggerType,'EnvironmentOptions/'); + //-- end; // hints @@ -1413,6 +1435,18 @@ begin copy(FDebuggerFilename,SpacePos,length(FDebuggerFilename)-SpacePos+1); end; +procedure TEnvironmentOptions.SetDebuggerType(const AValue: TDebuggerType); +const + CLASSNAMES: array[TDebuggerType] of String = ( + '', 'TGDBMIDEBUGGER', 'TSSHGDBMIDEBUGGER' + ); +begin + if FDebuggerType = AValue then Exit; + + FDebuggerType := AValue; + DebuggerClass := CLASSNAMES[FDebuggerType]; +end; + //============================================================================== { TEnvironmentOptionsDialog } diff --git a/ide/main.pp b/ide/main.pp index ad2f4e382d..54faa36d92 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -5626,7 +5626,7 @@ begin end; // Setup debugger - if EnvironmentOptions.DebuggerType <> dtNone + if EnvironmentOptions.DebuggerClass <> '' then begin if (DebugBoss.DoInitDebugger <> mrOk) then Exit; @@ -9367,6 +9367,9 @@ end. { ============================================================================= $Log$ + Revision 1.627 2003/07/30 23:15:38 marc + * Added RegisterDebugger + Revision 1.626 2003/07/28 18:02:05 mattias added findinfiles strat implementation from Bob Wingard