This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Unbuffer stdout and stderr on windows
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, brobecker at adacore dot com, yao at codesourcery dot com
- Date: Fri, 16 Aug 2013 18:13:44 +0300
- Subject: Re: [PATCH] Unbuffer stdout and stderr on windows
- References: <51EE23F8 dot 1070905 at codesourcery dot com> <83wqohw4ee dot fsf at gnu dot org> <20130729192559 dot GA5348 at ednor dot casa dot cgf dot cx> <83d2q1xiyv dot fsf at gnu dot org> <51F6C7B2 dot 3020400 at redhat dot com> <20130731034045 dot GA5565 at ednor dot casa dot cgf dot cx> <20130812211105 dot GA11128 at adacore dot com> <8361v9piop dot fsf at gnu dot org> <20130815173618 dot GA6955 at ednor dot casa dot cgf dot cx> <83eh9uonlg dot fsf at gnu dot org> <20130815175940 dot GD6955 at ednor dot casa dot cgf dot cx> <520E1109 dot 7000304 at redhat dot com> <83y581n5ag dot fsf at gnu dot org> <520E296C dot 8090906 at redhat dot com> <83siy9n44r dot fsf at gnu dot org> <520E339D dot 3020209 at redhat dot com> <83pptdn194 dot fsf at gnu dot org> <520E3F99 dot 6090403 at redhat dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.