This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Potential fix: gdb/strace swallows stderr


On Aug 18 11:49, Ryan Johnson wrote:
> On 18/08/2011 5:14 AM, Corinna Vinschen wrote:
> >I'm wondering how I could ever apply this.  The !not_open(2) is just
> >plain wrong (looks like a copy-paste bug).  If not_open(2), then we
> >*want* to initialize fd 2, no matter what.  If !not_open(2), then fd 2
> >has been initialized and we don't want to create a useless handle.
> >So the condition is just upside down.  I'll apply a patch.
> Hmm. Looking at webcvs, it seems you went with this route:
> if (out == err && (!being_debugged () || not_open (2)))
> 
> Maybe I'm just paranoid, but can it ever arise that out==err when
> !being_debugged()?

Yes.  The good old Windows telnet client was such a candidate.

> If so, is it correct to create a duplicate handle
> in that case? I assume it is, given the code comment about needing
> different handles. But then, if out==err because the debugger
> initialized them that way, wouldn't we again need to duplicate the
> handles to avoid whatever trouble is presumably caused by not
> duplicating them?

The idea is not to touch the handles if the debugger has set them up
that way.  I know that there was that case with some GDB version
way back when, but looking into the GDB sources from CVS, the code
which handled the cYgstd string is not present.

Chris, wasn't some set_child_tty function part of GDB at one point?
Or was that Red Hat only and never has been pushed upstream?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


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