gdb: New 'tui enable' and 'tui disable' commands.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 22 May 2015 08:07:42 +0000 (10:07 +0200)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 22 May 2015 10:18:49 +0000 (12:18 +0200)
Add new commands to specifically enable and disable tui mode.  This is
in addition to the readline bindings, but might be easier for a user to
discover if they accidentally end up in tui mode.

gdb/ChangeLog:

* NEWS: Mention 'tui enable' and 'tui disable'.
* tui/tui.c (tui_enable_command): New function.
(tui_disable_command): New function.
(_initialize_tui): New function.

gdb/doc/ChangeLog:

* gdb.texinfo (TUI): Include 'tui enable' in the introduction.
(TUI Commands): Add 'tui enable' and 'tui disable' details.

gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/tui/tui.c

index 42ef67d..f55b9c4 100644 (file)
@@ -1,3 +1,10 @@
+2015-05-22  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * NEWS: Mention 'tui enable' and 'tui disable'.
+       * tui/tui.c (tui_enable_command): New function.
+       (tui_disable_command): New function.
+       (_initialize_tui): New function.
+
 2015-05-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * tui/tui-regs.c (tui_reg_next_command): Use NULL not 0.
index e08dd0d..745444b 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -82,6 +82,10 @@ record bts
 compile print
   Evaluate expression by using the compiler and print result.
 
+tui enable
+tui disable
+  Explicit commands for enabling and disabling tui mode.
+
 * New options
 
 set max-completions
index f8b0487..445f64d 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-22  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.texinfo (TUI): Include 'tui enable' in the introduction.
+       (TUI Commands): Add 'tui enable' and 'tui disable' details.
+
 2015-05-16  Doug Evans  <xdje42@gmail.com>
 
        * guile.texi (Memory Ports in Guile): Document support for unbuffered
index 1665372..e38fd31 100644 (file)
@@ -24669,8 +24669,9 @@ is available.
 The TUI mode is enabled by default when you invoke @value{GDBN} as
 @samp{@value{GDBP} -tui}.
 You can also switch in and out of TUI mode while @value{GDBN} runs by
-using various TUI commands and key bindings, such as @kbd{C-x C-a}. 
-@xref{TUI Keys, ,TUI Key Bindings}.
+using various TUI commands and key bindings, such as @command{tui
+enable} or @kbd{C-x C-a}.  @xref{TUI Commands, ,TUI Commands} and
+@ref{TUI Keys, ,TUI Key Bindings}.
 
 @node TUI Overview
 @section TUI Overview
@@ -24944,6 +24945,16 @@ these commands will fail with an error, because it would not be
 possible or desirable to enable curses window management.
 
 @table @code
+@item tui enable
+@kindex tui enable
+Activate TUI mode.  The last active TUI window layout will be used if
+TUI mode has prevsiouly been used in the current debugging session,
+otherwise a default layout is used.
+
+@item tui disable
+@kindex tui disable
+Disable TUI mode, returning to the console interpreter.
+
 @item info win
 @kindex info win
 List and give the size of all displayed windows.
index 308e7ae..838471d 100644 (file)
@@ -540,6 +540,22 @@ tui_disable (void)
   tui_update_gdb_sizes ();
 }
 
+/* Command wrapper for enabling tui mode.  */
+
+static void
+tui_enable_command (char *args, int from_tty)
+{
+  tui_enable ();
+}
+
+/* Command wrapper for leaving tui mode.  */
+
+static void
+tui_disable_command (char *args, int from_tty)
+{
+  tui_disable ();
+}
+
 void
 strcat_to_buf (char *buf, int buflen, 
               const char *item_to_add)
@@ -652,3 +668,21 @@ tui_get_command_dimension (unsigned int *width,
   *height = TUI_CMD_WIN->generic.height;
   return 1;
 }
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_tui;
+
+void
+_initialize_tui (void)
+{
+  struct cmd_list_element **tuicmd;
+
+  tuicmd = tui_get_cmd_list ();
+
+  add_cmd ("enable", class_tui, tui_enable_command,
+          _("Enable TUI display mode."),
+          tuicmd);
+  add_cmd ("disable", class_tui, tui_disable_command,
+          _("Disable TUI display mode."),
+          tuicmd);
+}