• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisãoc1cd3163d99efe4f7cbe7f228859fd93f28e06bb (tree)
Hora2020-04-14 05:10:04
AutorTom Tromey <tom@trom...>
CommiterTom Tromey

Mensagem de Log

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.

Mudança Sumário

Diff

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
11 2020-04-13 Tom Tromey <tom@tromey.com>
22
3+ * utils.c (flush_streams): New function.
4+ * event-loop.c (gdb_wait_for_event): Call flush_streams.
5+
6+2020-04-13 Tom Tromey <tom@tromey.com>
7+
38 * event-loop.c (handle_file_event): Use warning, not
49 printf_unfiltered.
510
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -663,8 +663,7 @@ gdb_wait_for_event (int block)
663663 int num_found = 0;
664664
665665 /* Make sure all output is done before getting another event. */
666- gdb_stdout->flush ();
667- gdb_stderr->flush ();
666+ flush_streams ();
668667
669668 if (gdb_notifier.num_fds == 0)
670669 return -1;
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -691,6 +691,15 @@ malloc_failure (long size)
691691 }
692692 }
693693
694+/* See common/errors.h. */
695+
696+void
697+flush_streams ()
698+{
699+ gdb_stdout->flush ();
700+ gdb_stderr->flush ();
701+}
702+
694703 /* My replacement for the read system call.
695704 Used like `read' but keeps going if `read' returns too soon. */
696705
--- a/gdbsupport/ChangeLog
+++ b/gdbsupport/ChangeLog
@@ -1,5 +1,9 @@
11 2020-04-13 Tom Tromey <tom@tromey.com>
22
3+ * errors.h (flush_streams): Declare.
4+
5+2020-04-13 Tom Tromey <tom@tromey.com>
6+
37 * gdb_select.h: Move from ../gdb/.
48
59 2020-04-13 Tom Tromey <tom@tromey.com>
--- a/gdbsupport/errors.h
+++ b/gdbsupport/errors.h
@@ -87,4 +87,8 @@ extern void perror_with_name (const char *string) ATTRIBUTE_NORETURN;
8787
8888 extern void malloc_failure (long size) ATTRIBUTE_NORETURN;
8989
90+/* Flush stdout and stderr. Must be provided by the client. */
91+
92+extern void flush_streams ();
93+
9094 #endif /* COMMON_ERRORS_H */