public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Patrick Palka <patrick@parcs.ath.cx>
To: gdb-patches@sourceware.org
Cc: Patrick Palka <patrick@parcs.ath.cx>
Subject: [PATCH 2/5] tui: use tui_putc to output newline entered by the user
Date: Sun, 05 Jul 2015 21:04:00 -0000	[thread overview]
Message-ID: <1436130241-21443-2-git-send-email-patrick@parcs.ath.cx> (raw)
In-Reply-To: <1436130241-21443-1-git-send-email-patrick@parcs.ath.cx>

This is necessary to make sure that start_line and cur_line are set
properly right after a command has been entered.  We usually get away
with not doing so because most commands output text, and when they do
they do it through tui_putc/tui_puts which makes start_line and cur_line
get updated.  However if a command does not output text, then start_line
will not get updated in time.

This fixes the following bug in the TUI:

(gdb) break foo
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) n<Enter>

After typing n followed by pressing Enter, the last line starting with
"Make breakpoint pending ..." (i.e. the subprompt) will get overwritten
by the next prompt.  With this patch, the last line does not get
overwritten.  (That the subprompt gets overwritten when no text is
entered at all is mostly a separate issue.)

gdb/ChangeLog:

	* tui/tui-io.c (tui_getc): Use tui_putc instead of waddch to
	emit the newline.
---
 gdb/tui/tui-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 97906ce..ba42c18 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -620,7 +620,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');
         }
     }
   
-- 
2.5.0.rc0.5.g91e10c5.dirty

  reply	other threads:[~2015-07-05 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-05 21:03 [PATCH 0/5] An attempt to provide "scrolling" functionality to TUI (PR tui/14584) Patrick Palka
2015-07-05 21:04 ` [PATCH 1/5] tui: reset start_line whenever cur_line is reset Patrick Palka
2015-07-05 21:04   ` Patrick Palka [this message]
2015-07-05 21:04   ` [PATCH 5/5] tui: maintain a scrollback buffer and dump it upon exit (PR tui/14584) Patrick Palka
2015-07-05 21:04   ` [PATCH 3/5] tui: simplify and fix up handling of start_line in tui_redisplay_readline Patrick Palka
2015-07-05 21:04   ` [PATCH 4/5] tui: make updating of start_line in tui_puts more consistent Patrick Palka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436130241-21443-2-git-send-email-patrick@parcs.ath.cx \
    --to=patrick@parcs.ath.cx \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).