GDB 8.2.90 available for testing

Message ID 83wokxwl3a.fsf@gnu.org
State New, archived
Headers

Commit Message

Eli Zaretskii March 17, 2019, 3:56 p.m. UTC
  > 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?
  

Comments

Tom Tromey March 17, 2019, 5:31 p.m. UTC | #1
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> However, your change gave me an idea, and I think I came up with a bit
Eli> better fix, see below (the patch is again the current HEAD).  With
Eli> that, the original problem seems to be fixed, and we still don't
Eli> produce redundant lines in the command window.  WDYT?

I think as long as it works, it is good.  Thanks.

Tom
  
Eli Zaretskii March 17, 2019, 6:35 p.m. UTC | #2
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>,  palves@redhat.com,  brobecker@adacore.com,  gdb-patches@sourceware.org
> Date: Sun, 17 Mar 2019 11:31:27 -0600
> 
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
> 
> Eli> However, your change gave me an idea, and I think I came up with a bit
> Eli> better fix, see below (the patch is again the current HEAD).  With
> Eli> that, the original problem seems to be fixed, and we still don't
> Eli> produce redundant lines in the command window.  WDYT?
> 
> I think as long as it works, it is good.  Thanks.

So okay to push to both branches?
  
Tom Tromey March 18, 2019, 2:13 p.m. UTC | #3
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

>> From: Tom Tromey <tom@tromey.com>
>> Cc: Tom Tromey <tom@tromey.com>,  palves@redhat.com,  brobecker@adacore.com,  gdb-patches@sourceware.org
>> Date: Sun, 17 Mar 2019 11:31:27 -0600
>> 
>> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
>> 
Eli> However, your change gave me an idea, and I think I came up with a bit
Eli> better fix, see below (the patch is again the current HEAD).  With
Eli> that, the original problem seems to be fixed, and we still don't
Eli> produce redundant lines in the command window.  WDYT?
>> 
>> I think as long as it works, it is good.  Thanks.

Eli> So okay to push to both branches?

Yes, please.  Thanks.

Tom
  
Eli Zaretskii March 18, 2019, 6:08 p.m. UTC | #4
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>,  palves@redhat.com,  brobecker@adacore.com, 	gdb-patches@sourceware.org
> Date: Mon, 18 Mar 2019 08:13:30 -0600
> 
> >> I think as long as it works, it is good.  Thanks.
> 
> Eli> So okay to push to both branches?
> 
> Yes, please.  Thanks.

Thanks, done.
  

Patch

--- 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