aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-11-20 16:02:29 -0700
committerTom Tromey <tom@tromey.com>2019-12-01 13:17:37 -0700
commit82e3b5645f9c4edc1d84e57c32665d0e76bbbd77 (patch)
treeb8dc1a29f2b806f86b90d292cfe5935b7caeb22c /gdb
parent517d261dfafb7e5317b841b01ab853a76deb8128 (diff)
downloadgdb-82e3b5645f9c4edc1d84e57c32665d0e76bbbd77.zip
gdb-82e3b5645f9c4edc1d84e57c32665d0e76bbbd77.tar.gz
gdb-82e3b5645f9c4edc1d84e57c32665d0e76bbbd77.tar.bz2
Treat inactive TUI specially in "info win"
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
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/tui/tui-win.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e61b08b..497626d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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
\0.
* unittests/tui-selftests.c: New file.
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index b6204be..b0111d7 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -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;