Remove unnecessary calls to wrap_here and gdb_flush

Various spots in gdb currently know about the wrap buffer, and so are
careful to call wrap_here to be certain that all output has been
flushed.

Now that the pager is just an ordinary stream, this isn't needed, and
a simple call to gdb_flush is enough.

Similarly, there are places where gdb prints to gdb_stderr, but first
flushes gdb_stdout.  stderr_file already flushes gdb_stdout, so these
aren't needed.
This commit is contained in:
Tom Tromey
2022-01-03 17:12:22 -07:00
parent 6b0c115423
commit ebfc93611b
7 changed files with 3 additions and 21 deletions

View File

@ -46,19 +46,15 @@ print_flush (void)
}
/* We want all output to appear now, before we print the error. We
have 3 levels of buffering we have to flush (it's possible that
have 2 levels of buffering we have to flush (it's possible that
some of these should be changed to flush the lower-level ones
too): */
/* 1. The _filtered buffer. */
if (filtered_printing_initialized ())
gdb_stdout->wrap_here (0);
/* 2. The stdio buffer. */
/* 1. The stdio buffer. */
gdb_flush (gdb_stdout);
gdb_flush (gdb_stderr);
/* 3. The system-level buffer. */
/* 2. The system-level buffer. */
gdb_stdout_serial = serial_fdopen (fileno (ui->outstream));
if (gdb_stdout_serial)
{