GDBMI debugger: prevent endless loops

git-svn-id: trunk@47145 -
This commit is contained in:
martin 2014-12-09 00:46:24 +00:00
parent f78f0d056d
commit 0a55b11a3e
2 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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 = ''