+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.
+
2020-02-07 Tom Tromey <tromey@adacore.com>
PR breakpoints/24915:
int num_found = 0;
/* Make sure all output is done before getting another event. */
- gdb_flush (gdb_stdout);
- gdb_flush (gdb_stderr);
+ ui_file_flush (gdb_stdout);
+ ui_file_flush (gdb_stderr);
if (gdb_notifier.num_fds == 0)
return -1;
/* Don't use a _filtered function here. It causes the assumed
character position to be off, since the newline we read from
the user is not accounted for. */
- fputs_unfiltered (actual_gdb_prompt.c_str (), gdb_stdout);
+ fprintf_unfiltered (gdb_stdout, "%s", actual_gdb_prompt.c_str ());
gdb_flush (gdb_stdout);
}
}
ui_printf (arg, gdb_stdout);
reset_terminal_style (gdb_stdout);
wrap_here ("");
- gdb_flush (gdb_stdout);
+ ui_file_flush (gdb_stdout);
}
/* Implement the "eval" command. */
case FIO_FD_CONSOLE_OUT:
ui_file_write (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr,
(char *) buffer, length);
- gdb_flush (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr);
+ ui_file_flush (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr);
ret = length;
break;
default:
static void
gdb_os_flush_stdout (host_callback *p)
{
- gdb_flush (gdb_stdtarg);
+ ui_file_flush (gdb_stdtarg);
}
/* GDB version of os_write_stderr callback. */
static void
gdb_os_flush_stderr (host_callback *p)
{
- gdb_flush (gdb_stdtargerr);
+ ui_file_flush (gdb_stdtargerr);
}
/* GDB version of printf_filtered callback. */
tb[1] = 0;
fputs_unfiltered (tb, gdb_stdtarg);
}
- gdb_flush (gdb_stdtarg);
+ ui_file_flush (gdb_stdtarg);
}
struct stop_reply : public notif_event
\f
void
-gdb_flush (struct ui_file *file)
+ui_file_flush (struct ui_file *file)
{
file->flush ();
}
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);
}
void
stderr_file::puts (const char *linebuffer)
{
- gdb_flush (gdb_stdout);
+ ui_file_flush (gdb_stdout);
stdio_file::puts (linebuffer);
}
/* A preallocated null_file stream. */
extern null_file null_stream;
-extern void gdb_flush (ui_file *);
+extern void ui_file_flush (ui_file *);
extern int ui_file_isatty (struct ui_file *);
}
}
+/* See utils.h. */
+
+void
+gdb_flush (struct ui_file *stream)
+{
+ flush_wrap_buffer (stream);
+ ui_file_flush (stream);
+}
+
/* Indicate that if the next sequence of characters overflows the line,
a newline should be inserted here rather than when it hits the end.
If INDENT is non-null, it is a string to be printed to indent the
extern struct ui_file **current_ui_gdb_stderr_ptr (void);
extern struct ui_file **current_ui_gdb_stdlog_ptr (void);
+/* Flush STREAM. This is a wrapper for ui_file_flush that also
+ flushes any output pending from uses of the *_filtered output
+ functions; that output is kept in a special buffer so that
+ pagination and styling are handled properly. */
+extern void gdb_flush (struct ui_file *);
+
/* The current top level's ui_file streams. */
/* Normal results */