From patchwork Wed Nov 20 23:03:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 36075 Received: (qmail 105768 invoked by alias); 20 Nov 2019 23:03:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 105760 invoked by uid 89); 20 Nov 2019 23:03:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Nov 2019 23:03:24 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 1A5BF203A5; Wed, 20 Nov 2019 18:03:22 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id BA27120300 for ; Wed, 20 Nov 2019 18:03:20 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 9941B2816F for ; Wed, 20 Nov 2019 18:03:20 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Wed, 20 Nov 2019 18:03:20 -0500 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Treat inactive TUI specially in "info win" X-Gerrit-Change-Id: Ia860be8c786a71289da6609aa14d86b8365424db X-Gerrit-Change-Number: 692 X-Gerrit-ChangeURL: X-Gerrit-Commit: 429e7ce5b08c0597c7b8268376d1b6e87b9c42e4 References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/692 ...................................................................... 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-11-20 Tom Tromey * tui/tui-win.c (tui_all_windows_info): Treat inactive TUI specially. Change-Id: Ia860be8c786a71289da6609aa14d86b8365424db --- M gdb/ChangeLog M gdb/tui/tui-win.c 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cf65de2..be05c9d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-11-20 Tom Tromey + + * tui/tui-win.c (tui_all_windows_info): Treat inactive TUI + specially. + 2019-11-19 Tom Tromey * tui/tui-win.c (tui_partial_win_by_name): Move from tui-data.c. diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index c8d36c7..20b1fed 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -845,6 +845,12 @@ 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;