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


On Sat, Oct 06, 2001 at 02:35:48PM -0600, Tom Tromey wrote:
>Today I wrote a simple patch that arranges for the inferior's stdout
>and stderr to end up in the Console window.  This patch also makes it
>possible to run insight in the background -- something I've wanted for
>a long time.
>
>Unfortunately this patch has an undesirable side effect.  Since the
>inferior's stdout/stderr are now pipes and not terminals, by default
>they are given full, and not line, buffering (at least, that is
>consistent with what I see when debugging).  This makes this feature
>much less useful, as output from the inferior doesn't show up until it
>is flushed.
>
>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.  This looks hard enough that I'm not going to
>attempt it.

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

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

Using ptys would mean that you couldn't use this feature on MS-DOS or
straight windows but it should work fine under Cygwin.

cgf


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