From patchwork Sun Dec 1 20:28:06 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: 36410 Received: (qmail 115507 invoked by alias); 1 Dec 2019 20:28:12 -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 115480 invoked by uid 89); 1 Dec 2019 20:28:11 -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= 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; Sun, 01 Dec 2019 20:28:10 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id ACCA2202E5; Sun, 1 Dec 2019 15:28:08 -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 8B94C201E8; Sun, 1 Dec 2019 15:28:07 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 60D6A2816F; Sun, 1 Dec 2019 15:28:07 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Sun, 1 Dec 2019 15:28:06 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Tom Tromey , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [pushed] Treat inactive TUI specially in "info win" X-Gerrit-Change-Id: Ia860be8c786a71289da6609aa14d86b8365424db X-Gerrit-Change-Number: 692 X-Gerrit-ChangeURL: X-Gerrit-Commit: 82e3b5645f9c4edc1d84e57c32665d0e76bbbd77 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191201202807.60D6A2816F@gnutoolchain-gerrit.osci.io> The original change was created by Tom Tromey. 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-12-01 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 e61b08b..497626d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2019-12-01 Tom Tromey + * tui/tui-win.c (tui_all_windows_info): Treat inactive TUI + specially. + +2019-12-01 Tom Tromey + * 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 @@ 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;