From patchwork Thu Jul 4 17:02:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33546 Received: (qmail 105256 invoked by alias); 4 Jul 2019 17:03:25 -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 105003 invoked by uid 89); 4 Jul 2019 17:03:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 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=H*RU:esmtpa, H*r:esmtpa, HX-Spam-Relays-External:esmtpa X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.46.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 17:03:20 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 3181C173DA for ; Thu, 4 Jul 2019 12:03:19 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j58hhkjYmiQerj58hhEYc8; Thu, 04 Jul 2019 12:03:19 -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=16yTE9EQrpAdctDC2L/s7rhH99QG3SKqSCAs4AsEPyw=; b=rMfzMrL1VndFgULqWdUb8alcse dyuW9B1XJDpCQMJBqk6qZmD79YMNIb3lZsUBZxD0CwBmb7vlczl1SBIQhBxO8cHp17Jnw06xQF9WN Cwkflc5Yj4VJDf9Nn41djd/Hp; Received: from 174-29-58-150.hlrn.qwest.net ([174.29.58.150]:34692 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1hj58g-002sDI-Vl; Thu, 04 Jul 2019 12:03:19 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 13/61] Introduce tui_data_window::delete_data_content_windows method Date: Thu, 4 Jul 2019 11:02:23 -0600 Message-Id: <20190704170311.15982-14-tom@tromey.com> In-Reply-To: <20190704170311.15982-1-tom@tromey.com> References: <20190704170311.15982-1-tom@tromey.com> This changes tui_delete_data_content_windows to be a method on tui_data_window, removing some uses of the TUI_DATA_WIN global. 2019-07-04 Tom Tromey * tui/tui-windata.h (tui_delete_data_content_windows): Don't declare. * tui/tui-windata.c (tui_data_window::delete_data_content_windows): Rename from tui_delete_data_content_windows. (tui_data_window::display_all_data) (tui_data_window::do_scroll_vertical): Update. * tui/tui-data.h (struct tui_data_window) : New method. --- gdb/ChangeLog | 12 ++++++++++++ gdb/tui/tui-data.h | 4 ++++ gdb/tui/tui-windata.c | 8 ++++---- gdb/tui/tui-windata.h | 1 - 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 5cdd7561e62..9a908115231 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -507,6 +507,10 @@ struct tui_data_window : public tui_win_info content. It does not set the content. */ void display_all_data (); + /* Function to delete all the item windows in the data window. This + is usually done when the data window is scrolled. */ + void delete_data_content_windows (); + protected: void do_scroll_vertical (int num_to_scroll) override; diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c index dd2daf19332..02cd6d0b727 100644 --- a/gdb/tui/tui-windata.c +++ b/gdb/tui/tui-windata.c @@ -60,9 +60,9 @@ tui_data_window::first_data_item_displayed () /* Function to delete all the item windows in the data window. This is usually done when the data window is scrolled. */ void -tui_delete_data_content_windows (void) +tui_data_window::delete_data_content_windows () { - for (auto &&win : TUI_DATA_WIN->regs_content) + for (auto &&win : regs_content) { tui_delete_win (win->handle); win->handle = NULL; @@ -104,7 +104,7 @@ tui_data_window::display_all_data () else { tui_erase_data_content (NULL); - tui_delete_data_content_windows (); + delete_data_content_windows (); tui_check_and_display_highlight_if_needed (this); tui_display_registers_from (0); } @@ -156,7 +156,7 @@ tui_data_window::do_scroll_vertical (int num_to_scroll) { first_line += num_to_scroll; tui_erase_data_content (NULL); - tui_delete_data_content_windows (); + delete_data_content_windows (); tui_display_registers_from_line (first_line); } } diff --git a/gdb/tui/tui-windata.h b/gdb/tui/tui-windata.h index fce4e6defc9..419b22f3658 100644 --- a/gdb/tui/tui-windata.h +++ b/gdb/tui/tui-windata.h @@ -25,6 +25,5 @@ #include "tui/tui-data.h" extern void tui_erase_data_content (const char *); -extern void tui_delete_data_content_windows (void); #endif /* TUI_TUI_WINDATA_H */