Re: [PATCH] Unbuffer stdout and stderr on windows

Eli Zaretskii
2013-08-16T14:03:16Z

> Date: Fri, 16 Aug 2013 14:37:23 +0100
> From: Pedro Alves <palves@redhat.com>
> CC: gdb-patches@sourceware.org, brobecker@adacore.com,
> Eli Zaretskii <eliz@gnu.org>
>
> How can it cause trouble? If anything, it should be fully buffered
> that causes trouble (for output not coming out when it should). I
> really can't see when ever would it be desirable to hold GDB output
> until the internal buffer fills. So if GDB is supposed to be working when
> IO is fully buffered, some other mechanism must be forcing flushes on
> line ends (probably the gdb_flush calls). And then, if that is supposed
> to work, the testsuite really isn't special, and what we have is that
> the flushing mechanism isn't being activated in all the necessary places.

If you are thinking about using GDB interactively from a Windows
console, these issues are not really applicable, because console
output has its own rules. And, as you point out, GDB flushes its
stdout quite a lot anyway. So the current stdout should really behave
close to line-buffered.

I suggest not to broaden the issue beyond the original problem, lest
we will be unable to solve it.