public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][PR gdb/21690] Fix interruption of command history search
       [not found] <20200425171654.5727-1-ssbssa.ref@yahoo.de>
@ 2020-04-25 17:16 ` Hannes Domani
  0 siblings, 0 replies; only message in thread
From: Hannes Domani @ 2020-04-25 17:16 UTC (permalink / raw)
  To: gdb-patches

If you press Ctrl-C during an incremental search of the readline history, the
prompt is reset, but readline is still in the incremental search mode.

The call of rl_callback_sigcleanup cleans up the internal readline state, and
disables the incremental search mode.

gdb/ChangeLog:

2020-04-25  Hannes Domani  <ssbssa@yahoo.de>

	PR gdb/21690
	* main.c (start_event_loop): Call rl_callback_sigcleanup.
---
 gdb/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gdb/main.c b/gdb/main.c
index 59cb14161b..a8c1d3ccb1 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -55,6 +55,8 @@
 #include "gdbsupport/alt-stack.h"
 #include "observable.h"
 
+#include "readline/readline.h"
+
 /* The selected interpreter.  This will be used as a set command
    variable, so it should always be malloc'ed - since
    do_setshow_command will free it.  */
@@ -371,6 +373,8 @@ start_event_loop ()
 	     in a messed-up state.  Reset it here.  */
 	  current_ui->prompt_state = PROMPT_NEEDED;
 	  gdb::observers::command_error.notify ();
+	  /* Clean up internal state of the callback interface.  */
+	  rl_callback_sigcleanup ();
 	  /* This call looks bizarre, but it is required.  If the user
 	     entered a command that caused an error,
 	     after_char_processing_hook won't be called from
-- 
2.26.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-25 17:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200425171654.5727-1-ssbssa.ref@yahoo.de>
2020-04-25 17:16 ` [PATCH][PR gdb/21690] Fix interruption of command history search Hannes Domani

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