aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-10-26 10:38:57 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-10-26 10:38:57 +0000
commit57266a339fa59d1217421a96fa52f9629ef180f6 (patch)
tree2627e0b3a34904fed5b0983d77a902f406fc9732 /gdb
parent26abbdc424a78141936ead791fda7541fa9bd3fb (diff)
downloadgdb-57266a339fa59d1217421a96fa52f9629ef180f6.zip
gdb-57266a339fa59d1217421a96fa52f9629ef180f6.tar.gz
gdb-57266a339fa59d1217421a96fa52f9629ef180f6.tar.bz2
* tuiIO.c (tui_prep_terminal): Save the prompt registered in readline.
(tui_redisplay_readline): Use the last saved prompt. (tui_rl_saved_prompt): New.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/tui/ChangeLog6
-rw-r--r--gdb/tui/tuiIO.c13
2 files changed, 17 insertions, 2 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 7d67b5e..c0fb2bed 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-26 Stephane Carrez <stcarrez@nerim.fr>
+
+ * tuiIO.c (tui_prep_terminal): Save the prompt registered in readline.
+ (tui_redisplay_readline): Use the last saved prompt.
+ (tui_rl_saved_prompt): New.
+
2002-10-25 Stephane Carrez <stcarrez@nerim.fr>
Fix PR gdb/787
diff --git a/gdb/tui/tuiIO.c b/gdb/tui/tuiIO.c
index 3968a0a..b9b373c 100644
--- a/gdb/tui/tuiIO.c
+++ b/gdb/tui/tuiIO.c
@@ -124,6 +124,10 @@ 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;
+
static unsigned int _tuiHandleResizeDuringIO (unsigned int);
static void
@@ -194,7 +198,7 @@ tui_redisplay_readline (void)
if (tui_current_key_mode == tui_single_key_mode)
prompt = "";
else
- prompt = get_prompt ();
+ prompt = tui_rl_saved_prompt;
c_pos = -1;
c_line = -1;
@@ -256,10 +260,15 @@ tui_redisplay_readline (void)
}
/* Readline callback to prepare the terminal. It is called once
- each time we enter readline. There is nothing to do in curses mode. */
+ each time we enter readline. Terminal is already setup in curses mode. */
static void
tui_prep_terminal (void)
{
+ /* 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 = xstrdup (rl_prompt);
}
/* Readline callback to restore the terminal. It is called once