This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] TUI: check whether in secondary prompt instead of immediate_quit


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ab33ab13aa093778263d554dd0e702814a5a8cbd

commit ab33ab13aa093778263d554dd0e702814a5a8cbd
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Apr 12 16:49:29 2016 +0100

    TUI: check whether in secondary prompt instead of immediate_quit
    
    As can be seen in the tui_redisplay_readline comment:
    
     "The command could call prompt_for_continue and we must not restore
     SingleKey so that the prompt and normal keymap are used."
    
    immediate_quit is being used as proxy for "secondary prompt".
    
    We have a better predicate nowadays, so use it.
    
    gdb/ChangeLog:
    2016-04-12  Pedro Alves  <palves@redhat.com>
    
    	* tui/tui-io.c (tui_redisplay_readline): Check
    	gdb_in_secondary_prompt_p instead of immediate_quit.
    	* tui/tui.c: Include top.h.
    	(tui_rl_startup_hook): Check gdb_in_secondary_prompt_p instead of
    	immediate_quit.

Diff:
---
 gdb/ChangeLog    | 8 ++++++++
 gdb/tui/tui-io.c | 2 +-
 gdb/tui/tui.c    | 4 +++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8cc3474..aa23a65 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
 2016-04-12  Pedro Alves  <palves@redhat.com>
 
+	* tui/tui-io.c (tui_redisplay_readline): Check
+	gdb_in_secondary_prompt_p instead of immediate_quit.
+	* tui/tui.c: Include top.h.
+	(tui_rl_startup_hook): Check gdb_in_secondary_prompt_p instead of
+	immediate_quit.
+
+2016-04-12  Pedro Alves  <palves@redhat.com>
+
 	* top.c (read_command_file): Inline command_loop here.
 	(command_loop): Delete.
 
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 18c648c..3fa32db 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -212,7 +212,7 @@ tui_redisplay_readline (void)
      The command could call prompt_for_continue and we must not
      restore SingleKey so that the prompt and normal keymap are used.  */
   if (tui_current_key_mode == TUI_ONE_COMMAND_MODE && rl_end == 0
-      && immediate_quit == 0)
+      && !gdb_in_secondary_prompt_p ())
     tui_set_key_mode (TUI_SINGLE_KEY_MODE);
 
   if (tui_current_key_mode == TUI_SINGLE_KEY_MODE)
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 273a0d9..96f8df7 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -38,6 +38,7 @@
 #include "symtab.h"
 #include "source.h"
 #include "terminal.h"
+#include "top.h"
 
 #include <ctype.h>
 #include <signal.h>
@@ -302,7 +303,8 @@ static int
 tui_rl_startup_hook (void)
 {
   rl_already_prompted = 1;
-  if (tui_current_key_mode != TUI_COMMAND_MODE && immediate_quit == 0)
+  if (tui_current_key_mode != TUI_COMMAND_MODE
+      && !gdb_in_secondary_prompt_p ())
     tui_set_key_mode (TUI_SINGLE_KEY_MODE);
   tui_redisplay_readline ();
   return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]