[PATCH] Unbuffer stdout and stderr on windows

Eli Zaretskii eliz@gnu.org
Fri Aug 16 15:13:00 GMT 2013


> Date: Fri, 16 Aug 2013 16:04:57 +0100
> From: Pedro Alves <palves@redhat.com>
> CC: gdb-patches@sourceware.org, brobecker@adacore.com, yao@codesourcery.com
> 
> Ack.  I can't say I really agree with this rationale.  The problem
> exists, and hiding it under the rug won't make it go away.  Actually
> forcing it to happen more frequently should make it easier to
> iron out all the kinks.  IIUC, this is just a layer that
> splits input into whole lines before passing it up to higher
> levels, thus emulating line buffering.  I'm failing to see why
> that is heuristic, rather than something that works 100% of the
> time, given that that sounds just like fgets.

Because Emacs decodes text as soon as it receives it, to show it to
users.  It could delay a bit, but not too much, because users will
complain.

> So that actually supports my theory, and, my earlier suggestion
> that if fully unbuffered is undesirable, then instead make sure to
> always flush stdout before switching output to stderr, and vice
> versa, so the order is preserved.

I think this is a good solution, if indeed it solves the original
problem.



More information about the Gdb-patches mailing list