[PATCH] Remove excess calls to gdb_flush

Kevin Buettner kevinb@redhat.com
Tue Feb 19 22:12:00 GMT 2019


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



More information about the Gdb-patches mailing list