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

View File

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