public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Make isearch change readline prompt in TUI
Date: Fri, 20 Dec 2019 16:57:00 -0000	[thread overview]
Message-ID: <364d710448e607e4ae9cb338583179dd6e734f0b@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 364d710448e607e4ae9cb338583179dd6e734f0b ***

commit 364d710448e607e4ae9cb338583179dd6e734f0b
Author:     Tom Tromey <tom@tromey.com>
AuthorDate: Wed Nov 20 16:39:44 2019 -0700
Commit:     Tom Tromey <tom@tromey.com>
CommitDate: Fri Dec 20 08:49:52 2019 -0700

    Make isearch change readline prompt in TUI
    
    PR tui/23619 points out that isearch changes the prompt in the CLI gdb
    (and in Bash) -- but not in the TUI.  This turns out to be easily
    fixed by removing tui_rl_saved_prompt and instead using the prompt
    that readline computes.
    
    This is stored in rl_display_prompt, which according to git was added
    in readline 6.2.
    
    gdb/ChangeLog
    2019-12-20  Tom Tromey  <tom@tromey.com>
    
            PR tui/23619:
            * tui/tui-io.c (tui_rl_saved_prompt): Remove.
            (tui_redisplay_readline): Use rl_display_prompt.
            (tui_prep_terminal): Update.
    
    Change-Id: Iae97e9776a5540bbe52c73b05e4707941d9cd11a

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f7c84c01c9..1b838b9189 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-20  Tom Tromey  <tom@tromey.com>
+
+	PR tui/23619:
+	* tui/tui-io.c (tui_rl_saved_prompt): Remove.
+	(tui_redisplay_readline): Use rl_display_prompt.
+	(tui_prep_terminal): Update.
+
 2019-12-19  Christian Biesinger  <cbiesinger@google.com>
 
 	* configure: Regenerate.
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 2eef288bdb..d902d9e920 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -131,10 +131,6 @@ static FILE *tui_old_rl_outstream;
 static int tui_readline_pipe[2];
 #endif
 
-/* The last gdb prompt that was registered in readline.
-   This may be the main gdb prompt or a secondary prompt.  */
-static char *tui_rl_saved_prompt;
-
 /* Print a character in the curses command window.  The output is
    buffered.  It is up to the caller to refresh the screen if
    necessary.  */
@@ -538,7 +534,7 @@ tui_redisplay_readline (void)
   if (tui_current_key_mode == TUI_SINGLE_KEY_MODE)
     prompt = "";
   else
-    prompt = tui_rl_saved_prompt;
+    prompt = rl_display_prompt;
   
   c_pos = -1;
   c_line = -1;
@@ -606,11 +602,6 @@ tui_redisplay_readline (void)
 static void
 tui_prep_terminal (int notused1)
 {
-  /* Save the prompt registered in readline to correctly display it.
-     (we can't use gdb_prompt() due to secondary prompts and can't use
-     rl_prompt because it points to an alloca buffer).  */
-  xfree (tui_rl_saved_prompt);
-  tui_rl_saved_prompt = rl_prompt != NULL ? xstrdup (rl_prompt) : NULL;
 }
 
 /* Readline callback to restore the terminal.  It is called once each


             reply	other threads:[~2019-12-20 16:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 16:57 gdb-buildbot [this message]
2019-12-20 16:43 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
2019-12-20 17:22 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-12-21 14:05 ` Failures on Fedora-i686, " gdb-buildbot
2019-12-21 14:20 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-12-21 14:36 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-12-21 14:40 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-12-21 14:46 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-12-21 14:54 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-12-21 15:27 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2019-12-21 15:28 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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=364d710448e607e4ae9cb338583179dd6e734f0b@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@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).