From patchwork Wed Aug 21 02:25:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34210 Received: (qmail 29779 invoked by alias); 21 Aug 2019 02:25:56 -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 29589 invoked by uid 89); 21 Aug 2019 02:25:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_JMF_BL, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:4514 X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.185.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Aug 2019 02:25:46 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 41273400C9918 for ; Tue, 20 Aug 2019 20:51:10 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 0GJkiDf8DdnCe0GJkicpnB; Tue, 20 Aug 2019 21:25: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=ZS3tM0dINCAYxq+jX6EywaHdpDnn61xbPgmls0dT9n4=; b=OUnuH7D31bgfc4ReNdD9IZ2Ihv xyzBbojjoKJP2ZQdpIiaQ75IDhett8XA9pxebgKdkMbW24te04sen1KkH0QWR6N+/v+b1lFT23HyW eTSRETUtI199uAlMF312SWuvd; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:48672 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1i0GJk-001K6n-Jm; Tue, 20 Aug 2019 21:25:44 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 15/15] Remove tui_win_info::refresh_all Date: Tue, 20 Aug 2019 20:25:35 -0600 Message-Id: <20190821022535.9762-16-tom@tromey.com> In-Reply-To: <20190821022535.9762-1-tom@tromey.com> References: <20190821022535.9762-1-tom@tromey.com> The TUI has two duplicate "re-render this window" methods, "rerender" and "refresh_all". They differ only slightly in semantics, so I wanted to see if they could be unified. After looking into this, I decided that refresh_all was not needed. There are 4 calls to tui_refresh_all_win (the only caller of this method): 1. tui_enable. This sets the layout, which renders the windows. 2. tui_cont_sig. Here, I think it's sufficient to simply redraw the current window contents from the curses backing store, because gdb state didn't change while it was suspended 3. tui_dispatch_ctrl_char. This is the C-l handler, and here it's explicitly enough to just refresh the screen (as above). 4. tui_refresh_all_command. This is the command equivalent of C-l. So, this patch removes this method entirely and simplifies tui_refresh_all_win. gdb/ChangeLog 2019-08-20 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) : Don't declare. * tui/tui-winsource.c (tui_source_window_base::refresh_all): Remove. * tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or tui_show_locator_content. * tui/tui-regs.h (struct tui_data_window) : Don't declare. * tui/tui-regs.c (tui_data_window::refresh_all): Remove. * tui/tui-data.h (struct tui_win_info) : Don't declare. --- gdb/ChangeLog | 14 ++++++++++++++ gdb/tui/tui-data.h | 6 ------ gdb/tui/tui-regs.c | 23 ----------------------- gdb/tui/tui-regs.h | 2 -- gdb/tui/tui-win.c | 6 ------ gdb/tui/tui-winsource.c | 10 ---------- gdb/tui/tui-winsource.h | 2 -- 7 files changed, 14 insertions(+), 49 deletions(-) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 698acac338f..262cb595d4d 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -161,12 +161,6 @@ public: { } - /* Called after all the TUI windows are refreshed, to let this - window have a chance to update itself further. */ - virtual void refresh_all () - { - } - /* Compute the maximum height of this window. */ virtual int max_height () const; diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index f62ba065ebe..48e78fc9dbc 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -403,29 +403,6 @@ tui_data_window::rerender () } -/* Function to redisplay the contents of the data window. */ -void -tui_data_window::refresh_all () -{ - erase_data_content (NULL); - if (!regs_content.empty ()) - { - int first_element = first_data_item_displayed (); - - if (first_element >= 0) /* Re-use existing windows. */ - { - int first_line = (-1); - - if (first_element < regs_content.size ()) - first_line = line_from_reg_element_no (first_element); - - if (first_line >= 0) - display_registers_from_line (first_line); - } - } -} - - /* Scroll the data window vertically forward or backward. */ void tui_data_window::do_scroll_vertical (int num_to_scroll) diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index 1f9fa73f1cc..abf44c88b68 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -58,8 +58,6 @@ struct tui_data_window : public tui_win_info DISABLE_COPY_AND_ASSIGN (tui_data_window); - void refresh_all () override; - void refresh_window () override; const char *name () const override diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 64e38880a2c..8d41372cf90 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -504,12 +504,6 @@ tui_refresh_all_win (void) { clearok (curscr, TRUE); tui_refresh_all (); - for (tui_win_info *win_info : all_tui_windows ()) - { - if (win_info->is_visible ()) - win_info->refresh_all (); - } - tui_show_locator_content (); } void diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 0a3eb78bb5a..7a4821dc52c 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -280,16 +280,6 @@ tui_source_window_base::~tui_source_window_base () /* See tui-data.h. */ -void -tui_source_window_base::refresh_all () -{ - show_source_content (); - check_and_display_highlight_if_needed (); - update_exec_info (); -} - -/* See tui-data.h. */ - void tui_source_window_base::update_tab_width () { diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 1804ca7224a..4c98ca3ceb2 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -103,8 +103,6 @@ public: void clear_detail (); - void refresh_all () override; - /* Refill the source window's source cache and update it. If this is a disassembly window, then just update it. */ void refill ();