mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:19:18 +02:00
FpDebug: fix reading pty for console window.
This commit is contained in:
parent
fcd6d0493d
commit
47c34d2e7e
@ -1435,18 +1435,22 @@ function TDbgLinuxProcess.GetConsoleOutput: string;
|
|||||||
var
|
var
|
||||||
ABytesAvailable: DWord;
|
ABytesAvailable: DWord;
|
||||||
ABytesRead: cint;
|
ABytesRead: cint;
|
||||||
|
s: string;
|
||||||
begin
|
begin
|
||||||
if fpioctl(FMasterPtyFd, FIONREAD, @ABytesAvailable)<0 then
|
if fpioctl(FMasterPtyFd, FIONREAD, @ABytesAvailable)<0 then
|
||||||
ABytesAvailable := 0;
|
ABytesAvailable := 0;
|
||||||
|
|
||||||
if ABytesAvailable>0 then
|
|
||||||
begin
|
|
||||||
setlength(result, ABytesAvailable);
|
|
||||||
ABytesRead := fpRead(FMasterPtyFd, result[1], ABytesAvailable);
|
|
||||||
SetLength(result, ABytesRead);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
result := '';
|
result := '';
|
||||||
|
while ABytesAvailable>0 do
|
||||||
|
begin
|
||||||
|
setlength(s, ABytesAvailable);
|
||||||
|
ABytesRead := fpRead(FMasterPtyFd, s[1], ABytesAvailable);
|
||||||
|
SetLength(s, ABytesRead);
|
||||||
|
Result := Result + s;
|
||||||
|
|
||||||
|
if fpioctl(FMasterPtyFd, FIONREAD, @ABytesAvailable)<0 then
|
||||||
|
ABytesAvailable := 0;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDbgLinuxProcess.SendConsoleInput(AString: string);
|
procedure TDbgLinuxProcess.SendConsoleInput(AString: string);
|
||||||
|
Loading…
Reference in New Issue
Block a user