This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Flawed patch to capture inferior output
- To: Christopher Faylor <cgf at redhat dot com>
- Subject: Re: Flawed patch to capture inferior output
- From: Tom Tromey <tromey at redhat dot com>
- Date: 07 Oct 2001 14:59:56 -0600
- Cc: Insight List <insight at sources dot redhat dot com>
- References: <87bsjky09n.fsf@creche.redhat.com> <20011006234007.A2501@redhat.com>
- Reply-To: tromey at redhat dot com
>>>>> "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