Code in gdbsupport can't call gdb_flush, so this introduces a new
"flush_streams" function that must be supplied by the client.
Note that the similar gdb_flush_out_err exists, but it isn't defined
in quite the same way, so it wasn't clear to me whether the two could
be merged.
gdb/ChangeLog
2020-04-13 Tom Tromey <tom@tromey.com>
* utils.c (flush_streams): New function.
* event-loop.c (gdb_wait_for_event): Call flush_streams.
gdbsupport/ChangeLog
2020-04-13 Tom Tromey <tom@tromey.com>
* errors.h (flush_streams): Declare.
+2020-04-13 Tom Tromey <tom@tromey.com>
+
+ * utils.c (flush_streams): New function.
+ * event-loop.c (gdb_wait_for_event): Call flush_streams.
+
2020-04-13 Tom Tromey <tom@tromey.com>
* event-loop.c (handle_file_event): Use warning, not
int num_found = 0;
/* Make sure all output is done before getting another event. */
- gdb_stdout->flush ();
- gdb_stderr->flush ();
+ flush_streams ();
if (gdb_notifier.num_fds == 0)
return -1;
}
}
+/* See common/errors.h. */
+
+void
+flush_streams ()
+{
+ gdb_stdout->flush ();
+ gdb_stderr->flush ();
+}
+
/* My replacement for the read system call.
Used like `read' but keeps going if `read' returns too soon. */
+2020-04-13 Tom Tromey <tom@tromey.com>
+
+ * errors.h (flush_streams): Declare.
+
2020-04-13 Tom Tromey <tom@tromey.com>
* gdb_select.h: Move from ../gdb/.
extern void malloc_failure (long size) ATTRIBUTE_NORETURN;
+/* Flush stdout and stderr. Must be provided by the client. */
+
+extern void flush_streams ();
+
#endif /* COMMON_ERRORS_H */