summaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2007-07-01 22:37:52 +0000
committerDaniel Jacobowitz <dan@debian.org>2007-07-01 22:37:52 +0000
commit3f6cbc7a3c658a65f6b55930c80fb23c1f93cd7d (patch)
tree96577b9b02ba4e2cbc3f5df729af3c8db45986c1 /gdb/top.c
parent4d547446e8f661347efbb7c397ce11c9f3219eef (diff)
downloadgdb-3f6cbc7a3c658a65f6b55930c80fb23c1f93cd7d.tar.gz
2007-07-01 Daniel Jacobowitz <dan@codesourcery.com>
* top.c (gdb_readline_wrapper_line): Call rl_callback_handler_remove. (struct gdb_readline_wrapper_cleanup): Remove prompt_orig. (gdb_readline_wrapper_cleanup): Do not reset the prompt. (gdb_readline_wrapper): Do not save the prompt. Pass our prompt to display_gdb_prompt. 2007-07-01 Nick Roberts <nickrob@snap.net.nz> Daniel Jacobowitz <dan@codesourcery.com> * gdb.base/annota3.exp: Test for if construct.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 1681524dc6c..14a7c56856d 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -751,12 +751,16 @@ gdb_readline_wrapper_line (char *line)
/* Prevent operate-and-get-next from acting too early. */
saved_after_char_processing_hook = after_char_processing_hook;
after_char_processing_hook = NULL;
+
+ /* Prevent parts of the prompt from being redisplayed if annotations
+ are enabled, and readline's state getting out of sync. */
+ if (async_command_editing_p)
+ rl_callback_handler_remove ();
}
struct gdb_readline_wrapper_cleanup
{
void (*handler_orig) (char *);
- char *prompt_orig;
int already_prompted_orig;
};
@@ -766,7 +770,6 @@ gdb_readline_wrapper_cleanup (void *arg)
struct gdb_readline_wrapper_cleanup *cleanup = arg;
rl_already_prompted = cleanup->already_prompted_orig;
- PROMPT (0) = cleanup->prompt_orig;
gdb_assert (input_handler == gdb_readline_wrapper_line);
input_handler = cleanup->handler_orig;
@@ -790,14 +793,12 @@ gdb_readline_wrapper (char *prompt)
cleanup->handler_orig = input_handler;
input_handler = gdb_readline_wrapper_line;
- cleanup->prompt_orig = get_prompt ();
- PROMPT (0) = prompt;
cleanup->already_prompted_orig = rl_already_prompted;
back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup);
/* Display our prompt and prevent double prompt display. */
- display_gdb_prompt (NULL);
+ display_gdb_prompt (prompt);
rl_already_prompted = 1;
if (after_char_processing_hook)