This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove excess calls to gdb_flush
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at adacore dot com>
- Date: Tue, 19 Feb 2019 15:12:26 -0700
- Subject: Re: [PATCH] Remove excess calls to gdb_flush
- References: <20190219205426.4168-1-tromey@adacore.com>
On Tue, 19 Feb 2019 13:54:26 -0700
Tom Tromey <tromey@adacore.com> wrote:
> A customer noticed some mildly odd MI output, where CLI output was
> split into multiple MI strings at unusual boundaries, like this:
>
> ~"$1 = (b => true"
> ~", p => 0x407260"
>
> This is technically correct according to the MI spec, but still
> unusual, in that there's no particular reason for the string to be
> split where it is.
>
> I tracked this down to a call to gdb_flush in generic_val_print.
> Then, I went through all calls to gdb_flush and removed the ones I
> thought were superfluous. In particular:
>
> * Any call in the value-printing code;
> * Likewise the type-printing code (just a single call); and
> * Any call that immediately followed a printf that obviously
> ended with a newline, my belief being that gdb's standard output
> streams are line buffered (by inheriting the behavior from stdio)
>
> Regression tested on x86-64 Fedora 29.
>
> I didn't add a new test case. I tend to think we don't necessarily
> want to specify this behavior in the tests. Let me know what you
> think of this.
I agree with you regarding the test case.
I looked over the patch and didn't see any problems.
Kevin