* check if DebuggeTTY is a valid terminal

This commit is contained in:
pierre 2002-06-10 19:26:48 +00:00
parent 0963c54c19
commit 1dfb9e5a9b

View File

@ -755,6 +755,11 @@ begin
end; end;
procedure TDebugController.Run; procedure TDebugController.Run;
{$ifdef Unix}
var
Debuggeefile : text;
ResetOK, TTYUsed : boolean;
{$endif Unix}
begin begin
ResetBreakpointsValues; ResetBreakpointsValues;
{$ifdef win32} {$ifdef win32}
@ -769,8 +774,23 @@ begin
{ Run the debuggee in another tty } { Run the debuggee in another tty }
if DebuggeeTTY <> '' then if DebuggeeTTY <> '' then
begin begin
{$I-}
Assign(Debuggeefile,DebuggeeTTY);
system.Reset(Debuggeefile);
ResetOK:=IOResult=0;
If ResetOK and IsATTY(textrec(Debuggeefile).handle) then
begin
Command('tty '+DebuggeeTTY); Command('tty '+DebuggeeTTY);
if DebuggeeTTY<>TTYName(stdout) then TTYUsed:=true;
end
else
begin
Command('tty ');
TTYUsed:=false;
end;
if ResetOK then
close(Debuggeefile);
if TTYUsed and (DebuggeeTTY<>TTYName(stdout)) then
NoSwitch:= true NoSwitch:= true
else else
NoSwitch:=false; NoSwitch:=false;
@ -4113,7 +4133,10 @@ end.
{ {
$Log$ $Log$
Revision 1.20 2002-06-06 14:11:25 pierre Revision 1.21 2002-06-10 19:26:48 pierre
* check if DebuggeTTY is a valid terminal
Revision 1.20 2002/06/06 14:11:25 pierre
* handle win32 Ctrl-C change for graphic version * handle win32 Ctrl-C change for graphic version
Revision 1.19 2002/06/06 08:16:18 pierre Revision 1.19 2002/06/06 08:16:18 pierre