mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:39:23 +02:00
Debugger, GDBMI: Keep original error when trying alternative filenames.
git-svn-id: trunk@62609 -
This commit is contained in:
parent
797910c4a4
commit
3de674b205
@ -2204,10 +2204,26 @@ end;
|
|||||||
function TGDBMIDebuggerChangeFilenameBase.DoChangeFilename: Boolean;
|
function TGDBMIDebuggerChangeFilenameBase.DoChangeFilename: Boolean;
|
||||||
var
|
var
|
||||||
R: TGDBMIExecResult;
|
R: TGDBMIExecResult;
|
||||||
List: TGDBMINameValueList;
|
|
||||||
S, FileName: String;
|
S, FileName: String;
|
||||||
|
|
||||||
|
procedure SetErrorMsg;
|
||||||
|
var
|
||||||
|
List: TGDBMINameValueList;
|
||||||
|
begin
|
||||||
|
if (FErrorMsg = '') or
|
||||||
|
(pos('no such file', LowerCase(FErrorMsg)) > 0) or
|
||||||
|
(pos('not exist', LowerCase(FErrorMsg)) < 0)
|
||||||
|
then begin
|
||||||
|
List := TGDBMINameValueList.Create(R);
|
||||||
|
FErrorMsg := DeleteEscapeChars((List.Values['msg']));
|
||||||
|
List.Free;
|
||||||
|
end;
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
FErrorMsg := '';
|
||||||
FContext.ThreadContext := ccNotRequired;
|
FContext.ThreadContext := ccNotRequired;
|
||||||
FContext.StackContext := ccNotRequired;
|
FContext.StackContext := ccNotRequired;
|
||||||
|
|
||||||
@ -2218,6 +2234,8 @@ begin
|
|||||||
{$IFDEF darwin}
|
{$IFDEF darwin}
|
||||||
if (R.State = dsError) and (FileName <> '')
|
if (R.State = dsError) and (FileName <> '')
|
||||||
then begin
|
then begin
|
||||||
|
SetErrorMsg;
|
||||||
|
|
||||||
S := FTheDebugger.InternalFilename + '/Contents/MacOS/' + ExtractFileNameOnly(Filename);
|
S := FTheDebugger.InternalFilename + '/Contents/MacOS/' + ExtractFileNameOnly(Filename);
|
||||||
S := FTheDebugger.ConvertToGDBPath(S, cgptExeName);
|
S := FTheDebugger.ConvertToGDBPath(S, cgptExeName);
|
||||||
Result := ExecuteCommand('-file-exec-and-symbols %s', [S], R);
|
Result := ExecuteCommand('-file-exec-and-symbols %s', [S], R);
|
||||||
@ -2226,6 +2244,8 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if (R.State = dsError) and (FileName <> '') then
|
if (R.State = dsError) and (FileName <> '') then
|
||||||
begin
|
begin
|
||||||
|
SetErrorMsg;
|
||||||
|
|
||||||
FTheDebugger.InternalFilename := Filename + '.elf';
|
FTheDebugger.InternalFilename := Filename + '.elf';
|
||||||
S := FTheDebugger.ConvertToGDBPath(FTheDebugger.FileName, cgptExeName);
|
S := FTheDebugger.ConvertToGDBPath(FTheDebugger.FileName, cgptExeName);
|
||||||
Result := ExecuteCommand('-file-exec-and-symbols %s', [S], R);
|
Result := ExecuteCommand('-file-exec-and-symbols %s', [S], R);
|
||||||
@ -2234,10 +2254,7 @@ begin
|
|||||||
|
|
||||||
if (R.State = dsError) and (FTheDebugger.FileName <> '')
|
if (R.State = dsError) and (FTheDebugger.FileName <> '')
|
||||||
then begin
|
then begin
|
||||||
List := TGDBMINameValueList.Create(R);
|
SetErrorMsg;
|
||||||
FErrorMsg := DeleteEscapeChars((List.Values['msg']));
|
|
||||||
List.Free;
|
|
||||||
Result := False;
|
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user