aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-io.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-02 15:18:27 -0600
committerTom Tromey <tom@tromey.com>2019-07-17 12:19:20 -0600
commit88b7e7ccb958220adabc307e6d38fc66877820fb (patch)
tree644a77326e1bef1fb2a315d2acee7f40fd65d4cc /gdb/tui/tui-io.c
parent0fcd37117e94e5b9bf5f4aaa4dccc8038b38398e (diff)
downloadgdb-88b7e7ccb958220adabc307e6d38fc66877820fb.zip
gdb-88b7e7ccb958220adabc307e6d38fc66877820fb.tar.gz
gdb-88b7e7ccb958220adabc307e6d38fc66877820fb.tar.bz2
Fix flushing bug in tui_puts_internal
A while back I changed gdb not to flush in some places. It turned out that this broke the TUI a little. An easy way to see it is to run "gdb -tui -nx", then "file gdb" at the gdb prompt. gdb will print the usual "Reading symbols..." message -- but it won't appear on-screen until the reading is complete. This patch changes the TUI to do the equivalent of line buffering in tui_puts_internal. gdb/ChangeLog 2019-07-17 Tom Tromey <tom@tromey.com> * tui/tui-io.c (tui_puts_internal): Call wrefresh if newline is seen.
Diffstat (limited to 'gdb/tui/tui-io.c')
-rw-r--r--gdb/tui/tui-io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index c9607d8..cb27306 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -461,9 +461,13 @@ tui_puts_internal (WINDOW *w, const char *string, int *height)
{
char c;
int prev_col = 0;
+ bool saw_nl = false;
while ((c = *string++) != 0)
{
+ if (c == '\n')
+ saw_nl = true;
+
if (c == '\1' || c == '\2')
{
/* Ignore these, they are readline escape-marking
@@ -492,6 +496,8 @@ tui_puts_internal (WINDOW *w, const char *string, int *height)
}
}
update_cmdwin_start_line ();
+ if (saw_nl)
+ wrefresh (w);
}
/* Print a string in the curses command window. The output is