Treat inactive TUI specially in "info win"
authorTom Tromey <tom@tromey.com>
Wed, 20 Nov 2019 23:02:29 +0000 (16:02 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 1 Dec 2019 20:17:37 +0000 (13:17 -0700)
I noticed that "info win" will print the table header, but no windows,
when the TUI is inactive.  This patch changes this to print a message
instead.

gdb/ChangeLog
2019-12-01  Tom Tromey  <tom@tromey.com>

* tui/tui-win.c (tui_all_windows_info): Treat inactive TUI
specially.

Change-Id: Ia860be8c786a71289da6609aa14d86b8365424db

gdb/ChangeLog
gdb/tui/tui-win.c

index e61b08b49c8aeb85c76439f2997c67a97fc4a9ae..497626d3dc22173fda36f94a87e07f45e96128a9 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-01  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-win.c (tui_all_windows_info): Treat inactive TUI
+       specially.
+
 2019-12-01  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-winsource.c (tui_copy_source_line): Don't advance past
index b6204beb216836ef7b136a83efcf9d48c6a58cfb..b0111d7cf8cb5fb44357e84cfe987d5b67c01ff1 100644 (file)
@@ -847,6 +847,12 @@ tui_set_focus_command (const char *arg, int from_tty)
 static void
 tui_all_windows_info (const char *arg, int from_tty)
 {
+  if (!tui_active)
+    {
+      printf_filtered (_("The TUI is not active.\n"));
+      return;
+    }
+
   struct tui_win_info *win_with_focus = tui_win_with_focus ();
   struct ui_out *uiout = current_uiout;