Debugger, GDBMI Server: Added option to skip setting the local filename, if only a file on remote exists

git-svn-id: trunk@61540 -
This commit is contained in:
martin 2019-07-05 22:43:07 +00:00
parent e0d820d5dd
commit a610996b28
2 changed files with 28 additions and 7 deletions

View File

@ -532,7 +532,8 @@ type
TGDBMIDebuggerChangeFilenameBase = class(TGDBMIDebuggerCommand) TGDBMIDebuggerChangeFilenameBase = class(TGDBMIDebuggerCommand)
protected protected
FErrorMsg: String; FErrorMsg: String;
function DoChangeFilename: Boolean; procedure DoResetInternalBreaks; virtual;
function DoChangeFilename: Boolean; virtual;
function DoSetPascal: Boolean; function DoSetPascal: Boolean;
function DoSetCaseSensitivity: Boolean; function DoSetCaseSensitivity: Boolean;
function DoSetMaxValueMemLimit: Boolean; function DoSetMaxValueMemLimit: Boolean;
@ -2008,13 +2009,8 @@ end;
{ TGDBMIDebuggerChangeFilenameBase } { TGDBMIDebuggerChangeFilenameBase }
function TGDBMIDebuggerChangeFilenameBase.DoChangeFilename: Boolean; procedure TGDBMIDebuggerChangeFilenameBase.DoResetInternalBreaks;
var
R: TGDBMIExecResult;
List: TGDBMINameValueList;
S, FileName: String;
begin begin
Result := False;
FContext.ThreadContext := ccNotRequired; FContext.ThreadContext := ccNotRequired;
FContext.StackContext := ccNotRequired; FContext.StackContext := ccNotRequired;
@ -2028,6 +2024,17 @@ begin
FTheDebugger.FRtlUnwindExBreak.Clear(Self); FTheDebugger.FRtlUnwindExBreak.Clear(Self);
FTheDebugger.FSehRaiseBreaks.ClearAll(Self); FTheDebugger.FSehRaiseBreaks.ClearAll(Self);
if DebuggerState = dsError then Exit; if DebuggerState = dsError then Exit;
end;
function TGDBMIDebuggerChangeFilenameBase.DoChangeFilename: Boolean;
var
R: TGDBMIExecResult;
List: TGDBMINameValueList;
S, FileName: String;
begin
Result := False;
FContext.ThreadContext := ccNotRequired;
FContext.StackContext := ccNotRequired;
FileName := FTheDebugger.FileName; FileName := FTheDebugger.FileName;
S := FTheDebugger.ConvertToGDBPath(FileName, cgptExeName); S := FTheDebugger.ConvertToGDBPath(FileName, cgptExeName);
@ -3173,6 +3180,7 @@ end;
function TGDBMIDebuggerCommandChangeFilename.DoExecute: Boolean; function TGDBMIDebuggerCommandChangeFilename.DoExecute: Boolean;
begin begin
Result := True; Result := True;
DoResetInternalBreaks;
FSuccess := DoChangeFilename; FSuccess := DoChangeFilename;
end; end;
@ -5293,6 +5301,7 @@ begin
Exit; Exit;
end; end;
DoResetInternalBreaks;
if not DoChangeFilename then begin if not DoChangeFilename then begin
SetDebuggerErrorState(synfFailedToLoadApplicationExecutable, FErrorMsg); SetDebuggerErrorState(synfFailedToLoadApplicationExecutable, FErrorMsg);
exit; exit;

View File

@ -63,6 +63,7 @@ type
FDebugger_Remote_Port: string; FDebugger_Remote_Port: string;
FDebugger_Remote_DownloadExe: boolean; FDebugger_Remote_DownloadExe: boolean;
FRemoteTimeout: integer; FRemoteTimeout: integer;
FSkipSettingLocalExeName: Boolean;
public public
constructor Create; override; constructor Create; override;
procedure Assign(Source: TPersistent); override; procedure Assign(Source: TPersistent); override;
@ -72,6 +73,7 @@ type
property Debugger_Remote_DownloadExe: boolean read FDebugger_Remote_DownloadExe write FDebugger_Remote_DownloadExe; property Debugger_Remote_DownloadExe: boolean read FDebugger_Remote_DownloadExe write FDebugger_Remote_DownloadExe;
property RemoteTimeout: integer read FRemoteTimeout write FRemoteTimeout default -1; property RemoteTimeout: integer read FRemoteTimeout write FRemoteTimeout default -1;
property Architecture: string read FArchitecture write FArchitecture; property Architecture: string read FArchitecture write FArchitecture;
property SkipSettingLocalExeName: Boolean read FSkipSettingLocalExeName write FSkipSettingLocalExeName default False;
published published
property Debugger_Startup_Options; property Debugger_Startup_Options;
{$IFDEF UNIX} {$IFDEF UNIX}
@ -122,6 +124,7 @@ type
function GdbRunCommand: String; override; function GdbRunCommand: String; override;
procedure DetectTargetPid(InAttach: Boolean = False); override; procedure DetectTargetPid(InAttach: Boolean = False); override;
function DoTargetDownload: boolean; override; function DoTargetDownload: boolean; override;
function DoChangeFilename: Boolean; override;
end; end;
{ TGDBMIServerDebuggerCommandStartDebugging } { TGDBMIServerDebuggerCommandStartDebugging }
@ -148,6 +151,13 @@ begin
end; end;
end; end;
function TGDBMIServerDebuggerCommandStartDebugging.DoChangeFilename: Boolean;
begin
Result := True;
if not TGDBMIServerDebuggerProperties(DebuggerProperties).SkipSettingLocalExeName then
Result := inherited DoChangeFilename;
end;
{ TGDBMIServerDebuggerCommandInitDebugger } { TGDBMIServerDebuggerCommandInitDebugger }
function TGDBMIServerDebuggerCommandInitDebugger.DoExecute: Boolean; function TGDBMIServerDebuggerCommandInitDebugger.DoExecute: Boolean;
@ -192,6 +202,7 @@ begin
FDebugger_Remote_DownloadExe := False; FDebugger_Remote_DownloadExe := False;
FRemoteTimeout := -1; FRemoteTimeout := -1;
FArchitecture := ''; FArchitecture := '';
FSkipSettingLocalExeName := False;
UseAsyncCommandMode := True; UseAsyncCommandMode := True;
end; end;
@ -204,6 +215,7 @@ begin
FDebugger_Remote_DownloadExe := TGDBMIServerDebuggerProperties(Source).FDebugger_Remote_DownloadExe; FDebugger_Remote_DownloadExe := TGDBMIServerDebuggerProperties(Source).FDebugger_Remote_DownloadExe;
FRemoteTimeout := TGDBMIServerDebuggerProperties(Source).FRemoteTimeout; FRemoteTimeout := TGDBMIServerDebuggerProperties(Source).FRemoteTimeout;
FArchitecture := TGDBMIServerDebuggerProperties(Source).FArchitecture; FArchitecture := TGDBMIServerDebuggerProperties(Source).FArchitecture;
FSkipSettingLocalExeName := TGDBMIServerDebuggerProperties(Source).FSkipSettingLocalExeName;
UseAsyncCommandMode := True; UseAsyncCommandMode := True;
end; end;
end; end;