LazDebuggerGdbmi: Detect internal gdb errors, while waiting for run/step to end.

git-svn-id: branches/fixes_2_0@60485 -
This commit is contained in:
mattias 2019-02-24 14:01:43 +00:00
parent 90fe9a21f7
commit 9c00526c9e

View File

@ -2634,7 +2634,7 @@ end;
function TGDBMIDebuggerCommandExecuteBase.ProcessRunning(out AStoppedParams: String; out
AResult: TGDBMIExecResult; ATimeOut: Integer): Boolean;
var
InLogWarning: Boolean;
InLogWarning, ForceStop: Boolean;
function DoExecAsync(var Line: String): Boolean;
var
@ -2773,6 +2773,11 @@ var
FLogWarnings := FLogWarnings + Warning + LineEnding;
if Line = '&"\n"' then
InLogWarning := False;
if FTheDebugger.CheckForInternalError(Line, '') then begin
AResult.State := dsStop;
ForceStop := True;
end;
(*
<< TCmdLineDebugger.ReadLn "&"Warning:\n""
<< TCmdLineDebugger.ReadLn "&"Cannot insert breakpoint 11.\n""
@ -2797,6 +2802,7 @@ begin
GotPrompt := 0;
{$ENDIF}
Result := True;
ForceStop := False;
AResult.State := dsNone;
InLogWarning := False;
FGotStopped := False;
@ -2873,7 +2879,7 @@ begin
Break;
end;
if FTheDebugger.FAsyncModeEnabled and FGotStopped then begin
if ForceStop or (FTheDebugger.FAsyncModeEnabled and FGotStopped) then begin
// There should not be a "(gdb) ",
// but some versions print it, as they run none async, after accepting "run &"
S := FTheDebugger.ReadLine(True, 50);
@ -6859,16 +6865,16 @@ begin
FTheDebugger.FSehRaiseBreaks.ClearAll(Self);
{$endif}
FTheDebugger.FMainAddrBreak.Clear(Self);
end;
if (not ContinueExecution) and (DebuggerState = dsRun) and
(FTheDebugger.PauseWaitState <> pwsInternal)
then begin
// Handle the unforeseen
if (StoppedParams <> '')
then debugln(['ERROR: Got stop params, but did not change FTheDebugger.state: ', StoppedParams])
else debugln(['ERROR: Got NO stop params at all, but was running']);
SetDebuggerState(dsPause);
if (not ContinueExecution) and (DebuggerState = dsRun) and
(FTheDebugger.PauseWaitState <> pwsInternal)
then begin
// Handle the unforeseen
if (StoppedParams <> '')
then debugln(['ERROR: Got stop params, but did not change FTheDebugger.state: ', StoppedParams])
else debugln(['ERROR: Got NO stop params at all, but was running']);
SetDebuggerState(dsPause);
end;
end;
end;