This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
RE: How to get stderr to be displayed in the console
- From: Keith Seitz <keiths at redhat dot com>
- To: jbeniston at compxs dot com
- Cc: "insight at sources dot redhat dot com" <insight at sources dot redhat dot com>
- Date: Thu, 18 Nov 2004 09:43:38 -0800
- Subject: RE: How to get stderr to be displayed in the console
- References: <000801c4cd68$36df8e50$0bbda8c0@Kindrogan>
On Thu, 2004-11-18 at 04:14, Jon Beniston wrote:
> > I'm using Insight 6.0 on Windows/Cygwin. I'm debugging a
> > program using the remote serial interface. Text sent to
> > stdout appears in the insight console window, but text sent
> > to stderr appears in the window of the shell that started
> > insight.
>
> Similarly, stdin has to come from the shell rather than the Insight console.
> Further, stdin and stderr only seem to work if CYGWIN=tty is set. If not,
> then accessing stdin / stderr result in "Bad file number" errnos.
>
> Setting CYGWIN=tty screws up output in console mode GDB.
>
> Is this a bug or expected behaviour?
To be honest, I'm not entirely sure anymore. I think that stderr was
somewhat ignored when the original implementation of I/O handling went
in. It probably wouldn't be too tough to fix, though.
gdbtk-hooks.c:gdbtk_fputs deals with all of this.
As for cygwin native, I don't think that ever worked "properly", and I'm
not sure it ever will [but I could be wrong]. I believe that the unix
version will behave the same way, except for one minor point: we put in
a "workaround".
IMO, this was fixed properly in unix by adding the option to "Open
terminal for inferior I/O" to the target settings dialog. This is needed
because there is no way Insight's console is going to be fully
terminal-aware (for curses applications, for example), so we decided to
add this option.
If we could find a way to do the same thing under cygwin, that would be
the best solution. I just don't think it is any benefit to us to attempt
to deal with any possible terminal weirdness.
Keith