Make gdb_flush also flush the wrap buffer

This changes gdb_flush to also flush the internal wrap buffer.  A few
places needed to continue using the previous approach, so this also
introduces ui_file_flush for those.

2020-02-05  Iain Buclaw  <ibuclaw@gdcproject.org>

        * gdb/event-loop.c (gdb_wait_for_event): Update.
        * gdb/printcmd.c (printf_command): Update.
        * gdb/remote-fileio.c (remote_fileio_func_write): Update.
        * gdb/remote-sim.c (gdb_os_flush_stdout): Update.
        (gdb_os_flush_stderr): Update.
        * gdb/remote.c (remote_console_output): Update.
        * gdb/ui-file.c (gdb_flush): Rename to...
        (ui_file_flush): ...this.
        (stderr_file::write): Update.
        (stderr_file::puts): Update.
        * gdb/ui-file.h (gdb_flush): Rename to...
        (ui_file_flush): ...this.
        * gdb/utils.c (gdb_flush): Add function.
        * gdb/utils.h (gdb_flush): Add declaration.

Change-Id: I7ca143d30f03dc39f218f6e880eb9bca9e15af39
This commit is contained in:
Iain Buclaw 2020-02-05 12:25:09 +01:00 committed by Tom Tromey
parent 5abbbe1d13
commit faa17681cc
11 changed files with 44 additions and 12 deletions

View file

@ -91,7 +91,7 @@ null_file::write_async_safe (const char *buf, long sizeof_buf)
void
gdb_flush (struct ui_file *file)
ui_file_flush (struct ui_file *file)
{
file->flush ();
}
@ -315,7 +315,7 @@ stdio_file::can_emit_style_escape ()
void
stderr_file::write (const char *buf, long length_buf)
{
gdb_flush (gdb_stdout);
ui_file_flush (gdb_stdout);
stdio_file::write (buf, length_buf);
}
@ -325,7 +325,7 @@ stderr_file::write (const char *buf, long length_buf)
void
stderr_file::puts (const char *linebuffer)
{
gdb_flush (gdb_stdout);
ui_file_flush (gdb_stdout);
stdio_file::puts (linebuffer);
}