From patchwork Fri Aug 21 16:19:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 8342 Received: (qmail 110305 invoked by alias); 21 Aug 2015 16:20:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 110293 invoked by uid 89); 21 Aug 2015 16:20:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_20, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-qg0-f54.google.com Received: from mail-qg0-f54.google.com (HELO mail-qg0-f54.google.com) (209.85.192.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 21 Aug 2015 16:20:03 +0000 Received: by qged69 with SMTP id d69so49595973qge.0 for ; Fri, 21 Aug 2015 09:20:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UujfD1mBfWUTOixPiXjFUVxFjcBQbWGAcBoOG0CulcE=; b=EzSxiboMVnkOqqT1rjQXI3A5+MNVJnydCYixulFwuXoZgdwVOMioRqxiYSgSQkXlOM oXrgPohEtpusRzzYPz0bID7C/K6pfAGYmti/NLogxkazwcT3j3xUYUik5DadytAu17iy lFxAoKSvkIVNS9jMgibc/KrVjHf8OpYZ+JFzLM3wiiLASwOmNmf36PhGfg+O//uQgy0f oEm2nPbM16KD3x8ZzolonYlD3ynPDlIaQZOJd1XCIqLt2UFMHar+Dt+GxnFpyt8zPmW5 eiOd3CnpCHTgHDWv7M+yFEw+BxIfZSoek6zR6s1BUepjKnk6KmC2tNRoChfnQxaQAlC+ HMJA== X-Gm-Message-State: ALoCoQlIu9tJeCX4DcAhY8h8xlgswmbr6ONxI1hu7bpNsQwNDGKYG0S228jSKi0EZ4vK6MS2xZhD X-Received: by 10.140.146.214 with SMTP id 205mr20097748qhs.71.1440174000989; Fri, 21 Aug 2015 09:20:00 -0700 (PDT) Received: from localhost.localdomain (ool-4353acd8.dyn.optonline.net. [67.83.172.216]) by smtp.gmail.com with ESMTPSA id e19sm4608533qhc.18.2015.08.21.09.20.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Aug 2015 09:20:00 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Use tui_putc to output newline entered by the user Date: Fri, 21 Aug 2015 12:19:55 -0400 Message-Id: <1440173995-1244-1-git-send-email-patrick@parcs.ath.cx> 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. [ I extracted this patch out from my series that fixes PR tui/14584 because it's mostly an independent bugfix. ] 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 f0ff5c0..bca1f58 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -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'); } }