From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107602 invoked by alias); 4 Jul 2019 17:03:42 -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 106229 invoked by uid 89); 4 Jul 2019 17:03:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.46.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 17:03:27 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 3C4044010FA42 for ; Thu, 4 Jul 2019 12:03:26 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j58ohUsywYTGMj58ohNg0a; 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=773L97snit7OTSRORnZurWeEDqW75STxSq+v7nYFe8I=; b=NKrcrHsUUjRrCRsNko/uOgzzBh Ql2YKFVT9ejGt/fJA0GBvXreYDVZRlHwzmvclgoLAOgqesH27+GIgr97M6yJo4t7gISb4s+LM2QR/ /oQQ1ilGBdnqcHQ2hNb9/2SF0; 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-1T; Thu, 04 Jul 2019 12:03:26 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 32/61] Merge refresh and refresh_window methods Date: Thu, 04 Jul 2019 17:03:00 -0000 Message-Id: <20190704170311.15982-33-tom@tromey.com> In-Reply-To: <20190704170311.15982-1-tom@tromey.com> References: <20190704170311.15982-1-tom@tromey.com> X-SW-Source: 2019-07/txt/msg00123.txt.bz2 Earlier refactorings introduced the refresh and refresh_window methods, following the previous TUI code. However, these methods are essentially the same, so this patch merges them. It also removes some redundant refresh_window calls, because he execution window is updated automatically by the corresponding source (or disassembly) window. 2019-07-04 Tom Tromey * tui/tui-winsource.c (tui_show_exec_info_content): Don't call refresh_window. * tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Call touchwin. (tui_data_window::refresh_window): Call refresh_window on data items. Always call superclass refresh_window. (tui_win_info::refresh): Remove. (tui_source_window_base::refresh_window): Update. (tui_refresh_all): Update. * tui/tui-layout.c (show_source_disasm_command): Remove call to refresh_window. (show_source_or_disasm_and_command): Likewise. * tui/tui-data.h (struct tui_win_info) : Remove. (struct tui_source_window_base) : Likewise. --- gdb/ChangeLog | 17 +++++++++++++++++ gdb/tui/tui-data.h | 5 +---- gdb/tui/tui-layout.c | 2 -- gdb/tui/tui-wingeneral.c | 33 +++++++++++---------------------- gdb/tui/tui-winsource.c | 1 - 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 59c6f72e381..9d1d0dd5753 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -303,9 +303,6 @@ public: return false; } - /* Refresh this window and any associated windows. */ - virtual void refresh (); - /* Called after all the TUI windows are refreshed, to let this window have a chance to update itself further. */ virtual void refresh_all () @@ -380,7 +377,7 @@ public: } void make_visible (bool visible) override; - void refresh () override; + void refresh_window () override; void refresh_all () override; /* Refill the source window's source cache and update it. If this diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index a3ded203736..a02c157b87e 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -683,7 +683,6 @@ show_source_disasm_command (void) TUI_CMD_WIN->origin.y); tui_make_visible (TUI_CMD_WIN); } - TUI_CMD_WIN->refresh_window (); tui_set_current_layout_to (SRC_DISASSEM_COMMAND); } } @@ -924,7 +923,6 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type) { tui_win_list[CMD_WIN] = make_command_window (cmd_height, src_height); - TUI_CMD_WIN->refresh_window (); } else { diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 22f841eb88c..2902b8006b7 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -37,7 +37,10 @@ void tui_gen_win_info::refresh_window () { if (handle != NULL) - wrefresh (handle); + { + touchwin (handle); + wrefresh (handle); + } } /* See tui-data.h. */ @@ -49,12 +52,11 @@ tui_data_window::refresh_window () { for (auto &&win : regs_content) { - if (win != NULL && win->handle != NULL) - wrefresh (win->handle); + if (win != NULL) + win->refresh_window (); } } - else - tui_gen_win_info::refresh_window (); + tui_gen_win_info::refresh_window (); } /* Function to delete the curses window, checking for NULL. */ @@ -231,20 +233,10 @@ tui_make_all_invisible (void) /* See tui-data.h. */ void -tui_win_info::refresh () -{ - touchwin (handle); - refresh_window (); -} - -/* See tui-data.h. */ - -void -tui_source_window_base::refresh () +tui_source_window_base::refresh_window () { - touchwin (execution_info->handle); execution_info->refresh_window (); - tui_win_info::refresh (); + tui_win_info::refresh_window (); } /* Function to refresh all the windows currently displayed. */ @@ -257,13 +249,10 @@ tui_refresh_all () for (tui_win_info *win_info : all_tui_windows ()) { if (win_info->is_visible) - win_info->refresh (); + win_info->refresh_window (); } if (locator->is_visible) - { - touchwin (locator->handle); - locator->refresh_window (); - } + locator->refresh_window (); } diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 39591db2cc9..38d5532912d 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -513,7 +513,6 @@ tui_show_exec_info_content (struct tui_source_window_base *win_info) const tui_exec_info_content *content = exec_info->get_content (); werase (exec_info->handle); - exec_info->refresh_window (); for (int cur_line = 1; cur_line <= win_info->content.size (); cur_line++) mvwaddstr (exec_info->handle, cur_line, -- 2.17.2