This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Add possibility to force buffering mode for stdout/stderr
- From: Yao Qi <yao at codesourcery dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Sun, 25 Aug 2013 09:07:35 +0800
- Subject: Re: [RFC] Add possibility to force buffering mode for stdout/stderr
- References: <001201ce9e80$4b90b3e0$e2b21ba0$ at muller@ics-cnrs.unistra.fr>
On 08/21/2013 11:08 PM, Pierre Muller wrote:
basically adding
"-ex {maint setvbuf stdout full 1000000}"
or
"-ex {maint setvbuf stdout line 80}"
should allow to test both performance differences
induced by buffering changes and possible regressions
in testsuite results.
This patch is really only of interest to developers
using the testsuite or wanting to investigate
performance issues related to buffering.
Pierre,
I am afraid we can't call setvbuf on-the-fly to adjust the buffering to
a stream.
"The setvbuf() function may be used after the stream pointed to by
stream is associated with an open file but before any other operation"
See http://pubs.opengroup.org/onlinepubs/009696699/functions/setvbuf.html
setvbuf on Windows has similar requirement.
Even this command is only used once like "-ex {maint setvbuf stdout full
1000000}" or "-iex {maint setvbuf stdout line 80}", they are executed
after GDB printed version info to stdout, so it is not right to call
setvbuf, IMO.
--
Yao (éå)