mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 09:42:46 +02:00
DBG (via SSH): additional options for ssh, separate field to specify gdb
git-svn-id: trunk@37094 -
This commit is contained in:
parent
c8398bb037
commit
d5584e2893
@ -48,6 +48,7 @@ type
|
||||
private
|
||||
protected
|
||||
function ParseInitialization: Boolean; override;
|
||||
function CreateDebugProcess(const AOptions: String): Boolean; override;
|
||||
public
|
||||
class function CreateProperties: TDebuggerProperties; override; // Creates debuggerproperties
|
||||
class function Caption: String; override;
|
||||
@ -56,11 +57,22 @@ type
|
||||
class function RequiresLocalExecutable: Boolean; override;
|
||||
end;
|
||||
|
||||
{ TSSHGDBMIDebuggerProperties }
|
||||
|
||||
TSSHGDBMIDebuggerProperties = class(TGDBMIDebuggerProperties)
|
||||
private
|
||||
FAppendGDBtoSSHopt: Boolean;
|
||||
FNote: String; //dummy
|
||||
FRemoteGDBExe: String;
|
||||
FSSHStartupOptions: String;
|
||||
public
|
||||
constructor Create; override;
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
published
|
||||
property Note: String read FNote write FNote;
|
||||
property SSH_Startup_Options: String read FSSHStartupOptions write FSSHStartupOptions;
|
||||
property Remote_GDB_Exe: String read FRemoteGDBExe write FRemoteGDBExe;
|
||||
property Append_GDB_to_SSH_opt: Boolean read FAppendGDBtoSSHopt write FAppendGDBtoSSHopt;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -82,6 +94,24 @@ type
|
||||
AState: TPropEditDrawState); override;
|
||||
end;
|
||||
|
||||
{ TSSHGDBMIDebuggerProperties }
|
||||
|
||||
constructor TSSHGDBMIDebuggerProperties.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
FRemoteGDBExe := 'gdb';
|
||||
FSSHStartupOptions := '';
|
||||
FAppendGDBtoSSHopt := False;
|
||||
end;
|
||||
|
||||
procedure TSSHGDBMIDebuggerProperties.Assign(Source: TPersistent);
|
||||
begin
|
||||
inherited Assign(Source);
|
||||
FRemoteGDBExe := TSSHGDBMIDebuggerProperties(Source).FRemoteGDBExe;
|
||||
FSSHStartupOptions := TSSHGDBMIDebuggerProperties(Source).FSSHStartupOptions;
|
||||
FAppendGDBtoSSHopt := TSSHGDBMIDebuggerProperties(Source).FAppendGDBtoSSHopt;
|
||||
end;
|
||||
|
||||
{ TSSHGDBMINotePropertyEditor }
|
||||
|
||||
function TSSHGDBMINotePropertyEditor.GetAttributes: TPropertyAttributes;
|
||||
@ -91,8 +121,7 @@ end;
|
||||
|
||||
function TSSHGDBMINotePropertyEditor.GetValue: ansistring;
|
||||
begin
|
||||
Result := Format(lisTheGNUDebuggerThroughSshAllowsToRemoteDebugViaASsh, ['"',
|
||||
'"', '"', '"']);
|
||||
Result := Format(lisNewTheGNUDebuggerThroughSshAllowsToRemoteDebugViaASsh, []);
|
||||
end;
|
||||
|
||||
procedure TSSHGDBMINotePropertyEditor.PropMeasureHeight(const NewValue: ansistring; ACanvas: TCanvas; var AHeight: Integer);
|
||||
@ -219,6 +248,23 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSSHGDBMIDebugger.CreateDebugProcess(const AOptions: String): Boolean;
|
||||
var
|
||||
p: TSSHGDBMIDebuggerProperties;
|
||||
SshOpt: String;
|
||||
begin
|
||||
p := TSSHGDBMIDebuggerProperties(GetProperties);
|
||||
SshOpt := p.FSSHStartupOptions;
|
||||
if p.FAppendGDBtoSSHopt then begin
|
||||
Result := inherited CreateDebugProcess(SshOpt + ' ' + p.FRemoteGDBExe + ' ' + AOptions);
|
||||
end
|
||||
else begin
|
||||
Result := inherited CreateDebugProcess(SshOpt);
|
||||
if Result then
|
||||
SendCmdLn(p.FRemoteGDBExe + ' ' + AOptions);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPropertyEditor(TypeInfo(String), TSSHGDBMIDebuggerProperties, 'Note', TSSHGDBMINotePropertyEditor);
|
||||
|
||||
|
@ -5181,13 +5181,13 @@ resourcestring
|
||||
|
||||
//Jump History dialog
|
||||
lisJHJumpHistory = 'Jump History';
|
||||
lisTheGNUDebuggerThroughSshAllowsToRemoteDebugViaASsh =
|
||||
lisNewTheGNUDebuggerThroughSshAllowsToRemoteDebugViaASsh =
|
||||
'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: %s/usr/bin/ssh username@'
|
||||
+'hostname gdb%s or: %s/usr/bin/setsid /usr/bin/ssh username@hostname gdb%s';
|
||||
+'RemoteDebugging.txt for details. The path must contain the ssh client.'
|
||||
+'Use SSH_Startup_Options for the hostname and optional username.'
|
||||
+'And Remote_GDB_Exe for the filename of gdb on the remote computer.'
|
||||
+'';
|
||||
lisRemoveUnitFromUsesSection = 'Remove unit from uses section';
|
||||
lisRemoveLocalVariable = 'Remove local variable %s';
|
||||
lisHideMessageViaDirective = 'Hide message via directive';
|
||||
|
Loading…
Reference in New Issue
Block a user