From patchwork Thu Jul 4 17:02:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33568 Received: (qmail 107734 invoked by alias); 4 Jul 2019 17:03:43 -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 106292 invoked by uid 89); 4 Jul 2019 17:03:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.144.80) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 17:03:28 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway31.websitewelcome.com (Postfix) with ESMTP id D83D59D38 for ; Thu, 4 Jul 2019 12:03:26 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j58ohGil52qH7j58ohNqBL; Thu, 04 Jul 2019 12:03:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=R72VUBQ3Cz2KPY6ITSSbRjZCDHAkmljJaKfavqwL2rY=; b=KSm7neQzFHAqQCj5UyNXKXdyLL 1K2GitRp/oPi4xMnXNgU0bWJwOXvS5Fm+MJiuNSnsKg5h6+rFG4y9oIEqm8vXnyaruanEiIbjy0d5 RybiCHqvqHMrf0AKPK6U2IYE0; Received: from 174-29-58-150.hlrn.qwest.net ([174.29.58.150]:34696 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1hj58o-002sIW-KG; Thu, 04 Jul 2019 12:03:26 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 34/61] Remove TUI data window special case Date: Thu, 4 Jul 2019 11:02:44 -0600 Message-Id: <20190704170311.15982-35-tom@tromey.com> In-Reply-To: <20190704170311.15982-1-tom@tromey.com> References: <20190704170311.15982-1-tom@tromey.com> The TUI has a couple of special cases for updating the data window: one in tui_rl_other_windowand one in tui_set_focus_command. As part of the project to remove references to globals, I wanted to remove these calls; but when I did, some simple operations (like "C-x o") would cause the register window to blank. This fixes the underlying problem by arranging for the data window's refresh_window method to call the superclass method first, and then to refresh the child windows. Then the special cases can be removed. 2019-07-04 Tom Tromey * tui/tui.c (tui_rl_other_window): Update. * tui/tui-wingeneral.c (tui_data_window::refresh_window): Call superclass method first. Always iterate over regs_content. (tui_unhighlight_win, tui_highlight_win): Use refresh_window method. * tui/tui-win.c (tui_set_focus_command): Update. --- gdb/ChangeLog | 9 +++++++++ gdb/tui/tui-win.c | 2 -- gdb/tui/tui-wingeneral.c | 15 ++++++--------- gdb/tui/tui.c | 2 -- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 083f046cafa..9d9d9a5f577 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -857,8 +857,6 @@ The window name specified must be valid and visible.\n")); keypad (TUI_CMD_WIN->handle, (win_info != TUI_CMD_WIN)); } - if (TUI_DATA_WIN && TUI_DATA_WIN->is_visible) - TUI_DATA_WIN->refresh_all (); xfree (buf_ptr); printf_filtered (_("Focus set to %s window.\n"), tui_win_with_focus ()->name ()); diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 2902b8006b7..dc008cd7198 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -48,15 +48,12 @@ tui_gen_win_info::refresh_window () void tui_data_window::refresh_window () { - if (!regs_content.empty ()) + tui_gen_win_info::refresh_window (); + for (auto &&win : regs_content) { - for (auto &&win : regs_content) - { - if (win != NULL) - win->refresh_window (); - } + if (win != NULL) + win->refresh_window (); } - tui_gen_win_info::refresh_window (); } /* Function to delete the curses window, checking for NULL. */ @@ -108,7 +105,7 @@ tui_unhighlight_win (struct tui_win_info *win_info) && win_info->handle != NULL) { box_win (win_info, NO_HILITE); - wrefresh (win_info->handle); + win_info->refresh_window (); win_info->set_highlight (false); } } @@ -122,7 +119,7 @@ tui_highlight_win (struct tui_win_info *win_info) && win_info->handle != NULL) { box_win (win_info, HILITE); - wrefresh (win_info->handle); + win_info->refresh_window (); win_info->set_highlight (true); } } diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 693c2ff4a03..ee2c35587df 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -236,8 +236,6 @@ tui_rl_other_window (int count, int key) if (win_info) { tui_set_win_focus_to (win_info); - if (TUI_DATA_WIN && TUI_DATA_WIN->is_visible) - TUI_DATA_WIN->refresh_all (); keypad (TUI_CMD_WIN->handle, (win_info != TUI_CMD_WIN)); } return 0;