diff options
author | Doug Evans <dje@google.com> | 2015-02-04 12:27:28 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-02-04 12:27:28 +0100 |
commit | 518be979d905d8e8708c70149fdb3207aba53aa1 (patch) | |
tree | 96dcab35188d23687ff67cb799b0d3351bbcc22f /gdb/tui/tui-io.c | |
parent | f3853b34448594744f284fa96f26e41fd533a50d (diff) | |
download | gdb-518be979d905d8e8708c70149fdb3207aba53aa1.zip gdb-518be979d905d8e8708c70149fdb3207aba53aa1.tar.gz gdb-518be979d905d8e8708c70149fdb3207aba53aa1.tar.bz2 |
Speed up GDB's TUI output
In the TUI mode, we call wrefresh after outputting every single
character. This results in the I/O becoming very slow. Fix this by
delaying refreshing the console window until an explicit flush of
gdb_stdout is requested, or a write to any other (unbuffered) file is
done.
2015-02-04 Doug Evans <dje@google.com>
Pedro Alves <palves@redhat.com>
Eli Zaretskii <eliz@gnu.org>
PR tui/17810
* tui/tui-command.c (tui_refresh_cmd_win): New function.
* tui/tui-command.c (tui_refresh_cmd_win): Declare.
* tui/tui-file.c: #include tui/tui-command.h.
(tui_file_fputs): Refresh command window if stream is not gdb_stdout.
(tui_file_flush): Refresh command window if stream is gdb_stdout.
* tui/tui-io.c (tui_puts): Remove calls to wrefresh, fflush.
Diffstat (limited to 'gdb/tui/tui-io.c')
-rw-r--r-- | gdb/tui/tui-io.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 2b5a166..21b2a00 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -159,7 +159,10 @@ tui_putc (char c) tui_puts (buf); } -/* Print the string in the curses command window. */ +/* Print the string in the curses command window. + The output is buffered. It is up to the caller to refresh the screen + if necessary. */ + void tui_puts (const char *string) { @@ -201,10 +204,6 @@ tui_puts (const char *string) TUI_CMD_WIN->detail.command_info.curch); TUI_CMD_WIN->detail.command_info.start_line = TUI_CMD_WIN->detail.command_info.cur_line; - - /* We could defer the following. */ - wrefresh (w); - fflush (stdout); } /* Readline callback. |