Use tui_putc to output newline entered by the user
authorPatrick Palka <patrick@parcs.ath.cx>
Fri, 21 Aug 2015 16:04:25 +0000 (12:04 -0400)
committerPatrick Palka <patrick@parcs.ath.cx>
Fri, 21 Aug 2015 20:17:52 +0000 (16:17 -0400)
This is necessary to make sure that start_line is updated after a
command has been entered.  Usually, start_line gets updated anyway
because most commands output text, and outputting text is done through
the function tui_puts, which updates start_line.  However if a command
does not output text, then tui_puts will not get called and start_line
will not get updated in time for the next prompt to be displayed.

One can observe this bug by executing the command "delete" within TUI.
After executing, the prompt line

  (gdb) delete

gets overwritten by the next prompt.  With this patch, the prompt line
gets preserved.

gdb/ChangeLog:

* tui/tui-io.c (tui_getc): Use tui_putc instead of waddch to
emit the newline.

gdb/ChangeLog
gdb/tui/tui-io.c

index f5dd5f3e9b1aa17f22efbcc9e8abf0f3abc3216c..6ec04d0ad59b2479e0047e08f8d8bbbb3aeff46b 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-21  Patrick Palka  <patrick@parcs.ath.cx>
+
+       * tui/tui-io.c (tui_getc): Use tui_putc instead of waddch to
+       emit the newline.
+
 2015-08-21  Gary Benson  <gbenson@redhat.com>
 
        * gdb_bfd.c (gdb_bfd_iovec_fileio_pread): Add QUIT call.
index f0ff5c0bcb6ca77d2606fefd2abf6ff8f6301861..bca1f584409c912c663329e54822b660561a3e87 100644 (file)
@@ -606,7 +606,7 @@ tui_getc (FILE *fp)
          py += px / TUI_CMD_WIN->generic.width;
          px %= TUI_CMD_WIN->generic.width;
          wmove (w, py, px);
-         waddch (w, ch);
+         tui_putc ('\n');
         }
     }
   
This page took 0.032203 seconds and 4 git commands to generate.