diff --git a/components/lazdebuggergdbmi/gdbmidebugger.pp b/components/lazdebuggergdbmi/gdbmidebugger.pp index 925325773e..5defae66c6 100644 --- a/components/lazdebuggergdbmi/gdbmidebugger.pp +++ b/components/lazdebuggergdbmi/gdbmidebugger.pp @@ -8620,7 +8620,7 @@ begin else begin if DebugProcess = nil then MessageDlg('Debugger', 'Failed to create debug process for unknown reason', mtError, [mbOK], 0) - else MessageDlg('Debugger', Format('Failed to create debug process: %s', [ReadLine]), mtError, [mbOK], 0); + else MessageDlg('Debugger', Format('Failed to create debug process: %s', [ReadLine(50)]), mtError, [mbOK], 0); SetState(dsError); end; @@ -8706,7 +8706,7 @@ begin // Get initial debugger lines S := ''; Line := ReadLine; - while DebugProcessRunning and (Line <> '(gdb) ') do + while DebugProcessRunning and (Line <> '(gdb) ') and (State <> dsError) do begin if Line <> '' then diff --git a/components/lazdebuggergdbmi/sshgdbmidebugger.pas b/components/lazdebuggergdbmi/sshgdbmidebugger.pas index 8dfec63189..9e383cd8d9 100644 --- a/components/lazdebuggergdbmi/sshgdbmidebugger.pas +++ b/components/lazdebuggergdbmi/sshgdbmidebugger.pas @@ -204,7 +204,7 @@ function TSSHGDBMIDebugger.ParseInitialization: Boolean; // returns True if we should process it // returns False if it is the gdb prompt begin - ALine := ReadLine(True); + ALine := ReadLine(True, 250); Result := Pos('(gdb)', ALine) = 0; if Result then ALine := StripLN(ReadLine); @@ -215,7 +215,9 @@ begin Result := False; // strip leading empty lines - while CheckReadLine(Line) and (Line = '') do; + while CheckReadLine(Line) and (Line = '') and + (State <> dsError) and (not ReadLineTimedOut) and DebugProcessRunning + do ; // succesfull login ? while Pos('try again', Line) > 0 do CheckReadLine(Line); @@ -238,7 +240,8 @@ begin *) ExtraText := ''; - while CheckReadLine(Line) do + while CheckReadLine(Line) and (State <> dsError) and (not ReadLineTimedOut) and DebugProcessRunning + do begin // No prompt yet if ExtraText = ''