GdbmiDebugger, Windows: Improved commit 61117 #a08b1f9560 ("Improved speed..."): Only skip sleep, if there was a recent write to gdb. (Response expected)

git-svn-id: trunk@61132 -
This commit is contained in:
martin 2019-05-03 21:24:57 +00:00
parent e484e770ee
commit ef247de448

View File

@ -57,6 +57,7 @@ type
private private
{$IFdef MSWindows} {$IFdef MSWindows}
FAggressiveWaitTime: Cardinal; FAggressiveWaitTime: Cardinal;
FLastWrite: QWord;
{$EndIf} {$EndIf}
FDbgProcess: TProcessUTF8; // The process used to call the debugger FDbgProcess: TProcessUTF8; // The process used to call the debugger
FLineEnds: TStringDynArray; // List of strings considered as lineends FLineEnds: TStringDynArray; // List of strings considered as lineends
@ -264,11 +265,10 @@ begin
exit; exit;
t2 := GetTickCount64; t2 := GetTickCount64;
if (FullTimeOut > 0) then begin
if t2 < t if t2 < t
then t3 := t2 + (High(t) - t) then t3 := t2 + (High(t) - t)
else t3 := t2 - t; else t3 := t2 - t;
if (FullTimeOut > 0) then begin
if (t3 >= FullTimeOut) if (t3 >= FullTimeOut)
then begin then begin
ATimeOut := 0; ATimeOut := 0;
@ -280,6 +280,9 @@ begin
end; end;
{$IFdef MSWindows} {$IFdef MSWindows}
if t2 < FLastWrite
then t3 := t2 + (High(FLastWrite) - FLastWrite)
else t3 := t2 - FLastWrite;
if (t3 > FAggressiveWaitTime) or (FAggressiveWaitTime = 0) then begin if (t3 > FAggressiveWaitTime) or (FAggressiveWaitTime = 0) then begin
{$EndIf} {$EndIf}
ProcessWhileWaitForHandles; ProcessWhileWaitForHandles;
@ -614,6 +617,9 @@ begin
// for windows and *nix (1 or 2 character line ending) // for windows and *nix (1 or 2 character line ending)
LE := LineEnding; LE := LineEnding;
FDbgProcess.Input.Write(LE[1], Length(LE)); FDbgProcess.Input.Write(LE[1], Length(LE));
{$IFdef MSWindows}
FLastWrite := GetTickCount64;
{$EndIf}
end end
else begin else begin
DebugLn('[TCmdLineDebugger.SendCmdLn] Unable to send <', ACommand, '>. No process running.'); DebugLn('[TCmdLineDebugger.SendCmdLn] Unable to send <', ACommand, '>. No process running.');