From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50772 invoked by alias); 23 Jun 2019 22:44:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 48889 invoked by uid 89); 23 Jun 2019 22:43:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.4 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=invisible X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.51.6) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jun 2019 22:43:45 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 159CD400E5A75 for ; Sun, 23 Jun 2019 16:42:06 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fBD6hLtpM4FKpfBD6hcV99; Sun, 23 Jun 2019 17:43:44 -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=3JJFG+eHXPC8SRUwI40WHnZz+cFP2HwIHzGl55nQxIc=; b=Gd9PUPPR8QDSAKw/2yQAoLkqiH WveyerVcqbOM4jn5vHxSoVdnms7YBQHFYlHpp0o7TLyInyzg6Ofnd6UUkYL62myqJUPEud2ah3Pze qJRf8+h0CnALbF93+lrAQiVQi; Received: from 75-166-12-78.hlrn.qwest.net ([75.166.12.78]:54396 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hfBD6-000vDQ-40; Sun, 23 Jun 2019 17:43:44 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 23/66] Introduce the refresh method Date: Sun, 23 Jun 2019 22:44:00 -0000 Message-Id: <20190623224329.16060-24-tom@tromey.com> In-Reply-To: <20190623224329.16060-1-tom@tromey.com> References: <20190623224329.16060-1-tom@tromey.com> X-SW-Source: 2019-06/txt/msg00484.txt.bz2 This adds tui_win_info::refresh and updates tui_source_window_base to implement it as well. This lets us simplify tui_refresh_all, removing a check of the window type. gdb/ChangeLog 2019-06-23 Tom Tromey * tui/tui-wingeneral.c (tui_win_info::refresh) (tui_source_window_base::refresh): New methods. (tui_refresh_all): Call the refresh method. * tui/tui-data.h (struct tui_win_info) (struct tui_source_window_base) : New method. --- gdb/ChangeLog | 8 ++++++++ gdb/tui/tui-data.h | 4 ++++ gdb/tui/tui-wingeneral.c | 31 ++++++++++++++++++++----------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 34de67757b0..e25f8888c92 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -258,6 +258,9 @@ public: /* Make this window visible or invisible. */ virtual void make_visible (bool visible); + /* Refresh this window and any associated windows. */ + virtual void refresh (); + /* Methods to scroll the contents of this window. Note that they are named with "_scroll" coming at the end because the more obvious "scroll_forward" is defined as a macro in term.h. */ @@ -299,6 +302,7 @@ public: } void make_visible (bool visible) override; + void refresh () override; /* Does locator belongs to this window? */ bool m_has_locator = false; diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index e802e52ca5b..4d168af0c09 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -256,6 +256,25 @@ tui_make_all_invisible (void) make_all_visible (false); } +/* See tui-data.h. */ + +void +tui_win_info::refresh () +{ + touchwin (generic.handle); + tui_refresh_win (&generic); +} + +/* See tui-data.h. */ + +void +tui_source_window_base::refresh () +{ + touchwin (execution_info->handle); + tui_refresh_win (execution_info); + tui_win_info::refresh (); +} + /* Function to refresh all the windows currently displayed. */ void @@ -267,17 +286,7 @@ tui_refresh_all (struct tui_win_info **list) for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++) { if (list[type] && list[type]->generic.is_visible) - { - if (type == SRC_WIN || type == DISASSEM_WIN) - { - tui_source_window_base *base - = (tui_source_window_base *) list[type]; - touchwin (base->execution_info->handle); - tui_refresh_win (base->execution_info); - } - touchwin (list[type]->generic.handle); - tui_refresh_win (&list[type]->generic); - } + list[type]->refresh (); } if (locator->is_visible) { -- 2.17.2