From patchwork Fri Aug 16 16:15:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34146 Received: (qmail 74293 invoked by alias); 16 Aug 2019 16:15:46 -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 73984 invoked by uid 89); 16 Aug 2019 16:15:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.5 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: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.54.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Aug 2019 16:15:25 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 3D074400D6774 for ; Fri, 16 Aug 2019 10:10:52 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id yeslhZcKv2PzOyeslhafTt; Fri, 16 Aug 2019 11:15:15 -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=a7D/KMCCt+/lGEeZW5ulYsAE3pIFjv96ChUBOYBZqMM=; b=uhKIj4YtTGSXyHnI1H5FXu5jic cSsNyX6ntA8TqGnd2p13iovx0pMkqyLElhUephyPPDaApZzt6+9+O/tjyKDhYct2hsAtjosNAvgys L62cDEm4pa1Zer+zjVTB2lXE9; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:40466 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hyesl-002SJK-IG; Fri, 16 Aug 2019 11:15:15 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 6/9] Change tui_update_breakpoint_info to be a method Date: Fri, 16 Aug 2019 10:15:08 -0600 Message-Id: <20190816161511.16162-7-tom@tromey.com> In-Reply-To: <20190816161511.16162-1-tom@tromey.com> References: <20190816161511.16162-1-tom@tromey.com> This changes tui_update_breakpoint_info to be a method on tui_source_window_base. gdb/ChangeLog 2019-08-16 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) : Declare. (tui_update_breakpoint_info): Don't declare. * tui/tui-winsource.c (tui_source_window_base::update_source_window_as_is) (tui_update_all_breakpoint_info): Update. (tui_source_window_base::update_breakpoint_info): Rename from tui_update_breakpoint_info. (tui_source_window_base::update_exec_info): Update. --- gdb/ChangeLog | 11 +++++++++++ gdb/tui/tui-winsource.c | 21 +++++++++------------ gdb/tui/tui-winsource.h | 17 ++++++++--------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 3d1d6c4a97e..d0e18791e4a 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -99,7 +99,7 @@ tui_source_window_base::update_source_window_as_is erase_source_content (); else { - tui_update_breakpoint_info (this, nullptr, false); + update_breakpoint_info (nullptr, false); show_source_content (); update_exec_info (); if (type == SRC_WIN) @@ -448,10 +448,8 @@ tui_update_all_breakpoint_info (struct breakpoint *being_deleted) { for (tui_source_window_base *win : tui_source_windows ()) { - if (tui_update_breakpoint_info (win, being_deleted, false)) - { - win->update_exec_info (); - } + if (win->update_breakpoint_info (being_deleted, false)) + win->update_exec_info (); } } @@ -463,20 +461,19 @@ tui_update_all_breakpoint_info (struct breakpoint *being_deleted) refreshed. */ bool -tui_update_breakpoint_info (struct tui_source_window_base *win, - struct breakpoint *being_deleted, - bool current_only) +tui_source_window_base::update_breakpoint_info + (struct breakpoint *being_deleted, bool current_only) { int i; bool need_refresh = false; - for (i = 0; i < win->content.size (); i++) + for (i = 0; i < content.size (); i++) { struct breakpoint *bp; extern struct breakpoint *breakpoint_chain; struct tui_source_element *line; - line = &win->content[i]; + line = &content[i]; if (current_only && !line->is_exec_point) continue; @@ -498,7 +495,7 @@ tui_update_breakpoint_info (struct tui_source_window_base *win, for (loc = bp->loc; loc != NULL; loc = loc->next) { - if (win->location_matches_p (loc, i)) + if (location_matches_p (loc, i)) { if (bp->enable_state == bp_disabled) mode |= TUI_BP_DISABLED; @@ -529,7 +526,7 @@ void tui_source_window_base::update_exec_info () { werase (execution_info->handle); - tui_update_breakpoint_info (this, nullptr, true); + update_breakpoint_info (nullptr, true); for (int i = 0; i < content.size (); i++) { struct tui_source_element *src_element = &content[i]; diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 80608b5d733..30b29ca8fdc 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -142,6 +142,14 @@ public: struct symtab *s, struct tui_line_or_address line_or_addr); + /* Scan the source window and the breakpoints to update the + break_mode information for each line. Returns true if something + changed and the execution window must be refreshed. See + tui_update_all_breakpoint_info for a description of + BEING_DELETED. */ + bool update_breakpoint_info (struct breakpoint *being_deleted, + bool current_only); + /* Erase the source content. */ virtual void erase_source_content () = 0; @@ -239,15 +247,6 @@ struct tui_source_windows removed from the list of breakpoints. */ extern void tui_update_all_breakpoint_info (struct breakpoint *being_deleted); -/* Scan the source window and the breakpoints to update the break_mode - information for each line. Returns true if something changed and - the execution window must be refreshed. See - tui_update_all_breakpoint_info for a description of - BEING_DELETED. */ -extern bool tui_update_breakpoint_info (struct tui_source_window_base *win, - struct breakpoint *being_deleted, - bool current_only); - /* Function to display the "main" routine. */ extern void tui_display_main (void); extern void tui_update_source_windows_with_addr (struct gdbarch *, CORE_ADDR);