This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Flawed patch to capture inferior output


>>>>> "Chris" == Christopher Faylor <cgf@redhat.com> writes:

>> One way to fix this flaw would be to change gdbtk_redirect_io to
>> create a new terminal and then use the slave side as the inferior's
>> new stdout/stderr.

Chris> By "terminal" do you mean pty?  It seems to me that redirecting
Chris> I/O to a pipe could have all sorts of negative consequences for
Chris> programs that expect to be running under a tty.

Yeah, I mean a pty.

Using a pipe isn't all that bad since we already have the option to
run the inferior using a new xterm as its tty.  This option can be
used for any program that really needs a tty (for instance, when
debugging gdb with Insight).  (BTW the "run under xterm" option should
probably be per-session.  I'm not sure what the best way to implement
this is though.)

I don't know what the best approach is for debugging programs on
Windows.  The pipe patch I sent is only enabled on non-Windows
platforms.

Chris> The hard part is accomodating the various types of pty access
Chris> methods out there but there should be generic software around
Chris> that opens a pty in a way similar to a pipe and does the
Chris> equivalent of a popen().

Yeah.  I'll keep a copy of this patch; if I ever get inspired and find
code like this I'll dig it up again.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]