aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2003-07-24 20:23:17 +0000
committerStephane Carrez <stcarrez@nerim.fr>2003-07-24 20:23:17 +0000
commit3fc14bdbc9bc65cb69892cdde11884d0cb24968b (patch)
treef989b9bc31056db0408aee02cc53568ccafb2ee7 /gdb/tui
parente286caf2829593ec235a15a81e7ec76d2ccd3b46 (diff)
downloadgdb-3fc14bdbc9bc65cb69892cdde11884d0cb24968b.zip
gdb-3fc14bdbc9bc65cb69892cdde11884d0cb24968b.tar.gz
gdb-3fc14bdbc9bc65cb69892cdde11884d0cb24968b.tar.bz2
* tui.c (tui_rl_other_window): New function to switch the TUI active
window and give focus to a next window. (tui_initialize_readline): Bind it to c-x o. (tui_rl_next_keymap): Activate TUI mode when entering SingleKey mode.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/ChangeLog7
-rw-r--r--gdb/tui/tui.c27
2 files changed, 34 insertions, 0 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index a6574ff..40f4bd2 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,10 @@
+2003-07-24 Stephane Carrez <stcarrez@nerim.fr>
+
+ * tui.c (tui_rl_other_window): New function to switch the TUI active
+ window and give focus to a next window.
+ (tui_initialize_readline): Bind it to c-x o.
+ (tui_rl_next_keymap): Activate TUI mode when entering SingleKey mode.
+
2003-07-23 Stephane Carrez <stcarrez@nerim.fr>
* tui.c (tui_enable): Call tuiRefreshAll to make sure the window
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 7efe658..601a579 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -45,6 +45,7 @@
#include "tuiStack.h"
#include "tuiWin.h"
#include "tuiSourceWin.h"
+#include "tuiDataWin.h"
#include "readline/readline.h"
#include "target.h"
#include "frame.h"
@@ -210,6 +211,27 @@ tui_rl_delete_other_windows (int notused1, int notused2)
}
/* TUI readline command.
+ Switch the active window to give the focus to a next window. */
+static int
+tui_rl_other_window (int count, int key)
+{
+ TuiWinInfoPtr winInfo;
+
+ if (!tui_active)
+ tui_rl_switch_mode (0/*notused*/, 0/*notused*/);
+
+ winInfo = tuiNextWin (tuiWinWithFocus ());
+ if (winInfo)
+ {
+ tuiSetWinFocusTo (winInfo);
+ if (dataWin && dataWin->generic.isVisible)
+ tuiRefreshDataWin ();
+ keypad (cmdWin->generic.handle, (winInfo != cmdWin));
+ }
+ return 0;
+}
+
+/* TUI readline command.
Execute the gdb command bound to the specified key. */
static int
tui_rl_command_key (int count, int key)
@@ -248,6 +270,9 @@ tui_rl_command_mode (int count, int key)
static int
tui_rl_next_keymap (int notused1, int notused2)
{
+ if (!tui_active)
+ tui_rl_switch_mode (0/*notused*/, 0/*notused*/);
+
tui_set_key_mode (tui_current_key_mode == tui_command_mode
? tui_single_key_mode : tui_command_mode);
return 0;
@@ -326,6 +351,8 @@ tui_initialize_readline ()
rl_bind_key_in_map ('1', tui_rl_delete_other_windows, tui_ctlx_keymap);
rl_bind_key_in_map ('2', tui_rl_change_windows, emacs_ctlx_keymap);
rl_bind_key_in_map ('2', tui_rl_change_windows, tui_ctlx_keymap);
+ rl_bind_key_in_map ('o', tui_rl_other_window, emacs_ctlx_keymap);
+ rl_bind_key_in_map ('o', tui_rl_other_window, tui_ctlx_keymap);
rl_bind_key_in_map ('q', tui_rl_next_keymap, tui_keymap);
rl_bind_key_in_map ('s', tui_rl_next_keymap, emacs_ctlx_keymap);
rl_bind_key_in_map ('s', tui_rl_next_keymap, tui_ctlx_keymap);