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

git-svn-id: trunk@60474 -
This commit is contained in:
martin 2019-02-23 15:00:18 +00:00
parent ed5312942f
commit 1a62240d73

View File

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