Introduce and use flush_streams

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.
This commit is contained in:
Tom Tromey
2020-04-13 12:42:59 -06:00
committed by Tom Tromey
parent 29f2bf4f22
commit c1cd3163d9
5 changed files with 23 additions and 2 deletions

View File

@@ -87,4 +87,8 @@ extern void perror_with_name (const char *string) ATTRIBUTE_NORETURN;
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 */