From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org
Subject: Re: GDB 8.2.90 available for testing
Date: Sun, 17 Mar 2019 15:56:00 -0000 [thread overview]
Message-ID: <83wokxwl3a.fsf@gnu.org> (raw)
In-Reply-To: <878sxhfjk7.fsf@tromey.com> (message from Tom Tromey on Thu, 14 Mar 2019 11:32:40 -0600)
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>, palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org
> Date: Thu, 14 Mar 2019 11:32:40 -0600
>
> The appended patch seems to work ok for me, at the cost of leaving the
> gdb prompt in the TUI console window.
>
> Tom
>
> diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
> index ef1e88507aa..f3eb2273e6b 100644
> --- a/gdb/tui/tui-io.c
> +++ b/gdb/tui/tui-io.c
> @@ -631,7 +631,7 @@ gdb_wgetch (WINDOW *win)
> after the command. So, if we read \r, emit a \r now, after nl
> mode has been re-entered, so that the output looks correct. */
> if (r == '\r')
> - puts ("\r");
> + waddch (win, '\n');
> return r;
> }
Works for me, and I think that "cost" is a small one to pay.
However, your change gave me an idea, and I think I came up with a bit
better fix, see below (the patch is again the current HEAD). With
that, the original problem seems to be fixed, and we still don't
produce redundant lines in the command window. WDYT?
--- gdb/tui/tui-io.c~6 2019-03-17 14:03:10.448181200 +0200
+++ gdb/tui/tui-io.c 2019-03-17 14:03:53.951772800 +0200
@@ -696,12 +696,6 @@ gdb_wgetch (WINDOW *win)
nonl ();
int r = wgetch (win);
nl ();
- /* In nonl mode, if the user types Enter, it will not be echoed
- properly. This will result in gdb output appearing immediately
- after the command. So, if we read \r, emit a \r now, after nl
- mode has been re-entered, so that the output looks correct. */
- if (r == '\r')
- puts ("\r");
return r;
}
@@ -928,7 +922,7 @@ tui_getc (FILE *fp)
/* The \n must be echoed because it will not be printed by
readline. */
- if (ch == '\n')
+ if (ch == '\n' || ch == '\r')
{
/* When hitting return with an empty input, gdb executes the last
command. If we emit a newline, this fills up the command window
next prev parent reply other threads:[~2019-03-17 15:56 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 5:51 Joel Brobecker
2019-02-27 22:05 ` Jim Wilson
2019-03-04 11:15 ` Andrew Burgess
2019-03-04 13:57 ` Alan Hayward
2019-03-04 20:00 ` Jim Wilson
2019-02-28 18:31 ` MinGW build of GDB 8.2.90 (was: GDB 8.2.90 available for testing) Eli Zaretskii
2019-02-28 18:55 ` MinGW build of GDB 8.2.90 Sergio Durigan Junior
2019-02-28 19:06 ` LRN
2019-02-28 19:45 ` Eli Zaretskii
2019-02-28 20:17 ` Sergio Durigan Junior
2019-02-28 20:29 ` Eli Zaretskii
2019-02-28 20:37 ` Sergio Durigan Junior
2019-02-28 18:34 ` GDB 8.2.90 available for testing Eli Zaretskii
2019-03-01 16:35 ` Pedro Alves
2019-03-01 18:50 ` Tom Tromey
2019-03-07 22:44 ` Tom Tromey
2019-03-08 7:46 ` Eli Zaretskii
2019-03-08 20:57 ` Tom Tromey
2019-03-09 6:13 ` Eli Zaretskii
2019-03-14 17:32 ` Tom Tromey
2019-03-14 19:49 ` Eli Zaretskii
2019-03-15 12:55 ` Tom Tromey
2019-03-17 15:56 ` Eli Zaretskii [this message]
2019-03-17 17:31 ` Tom Tromey
2019-03-17 18:36 ` Eli Zaretskii
2019-03-18 14:13 ` Tom Tromey
2019-03-18 18:08 ` Eli Zaretskii
2019-03-07 17:42 ` Pedro Franco de Carvalho
[not found] ` <4d855905-32ce-ba4b-72f5-037f1796b37e@redhat.com>
2019-03-22 14:42 ` [PATCH] Fix testsuite hangs when gdb_test_multiple body errors out (Re: GDB 8.2.90 available for testing) Simon Marchi
2019-03-25 13:23 ` Pedro Alves
2019-03-22 20:44 ` Pedro Franco de Carvalho
2019-03-25 13:21 ` Pedro Alves
2019-03-25 19:43 ` Pedro Franco de Carvalho
2019-03-26 18:58 ` Pedro Alves
2019-03-26 21:01 ` Pedro Franco de Carvalho
2019-03-28 17:36 ` Joel Brobecker
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=83wokxwl3a.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=tom@tromey.com \
/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