From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from outbound-ss-820.bluehost.com (outbound-ss-820.bluehost.com [69.89.24.241]) by sourceware.org (Postfix) with ESMTPS id 4844B3857BA4 for ; Sat, 28 May 2022 02:42:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4844B3857BA4 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw12.mail.unifiedlayer.com (unknown [10.0.90.127]) by progateway2.mail.pro1.eigbox.com (Postfix) with ESMTP id B61DD1004818C for ; Sat, 28 May 2022 02:42:33 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id umPRnR7XqwPf0umPRn1N5m; Sat, 28 May 2022 02:42:33 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=F5ySyotN c=1 sm=1 tr=0 ts=62918c19 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=oZkIemNP1mAA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=ykSygeXs5fxpEkDuEsUA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=HhwvSuBCp0NHS6GXkC+f126eU1OtdI67S2IqkGq1ZW0=; b=SGrH1LafhPyE5+8770k/GxxJk7 hBNf35njHQIwgqRzF+o2kna76MNhVwrgTUCIxyAVBeCjwm5bPfk1Jh0PGFqidHs+m3Nnyr98DS3b+ PTUxd8jYvHuUxxb2d6N3V37oL; Received: from 71-211-158-194.hlrn.qwest.net ([71.211.158.194]:45628 helo=prentzel.Home) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1numPQ-003NVE-TS; Fri, 27 May 2022 20:42:32 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 1/3] Change breakpoint_re_set_default to a method Date: Fri, 27 May 2022 20:42:29 -0600 Message-Id: <20220528024231.474534-2-tom@tromey.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220528024231.474534-1-tom@tromey.com> References: <20220528024231.474534-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.158.194 X-Source-L: No X-Exim-ID: 1numPQ-003NVE-TS X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-158-194.hlrn.qwest.net (prentzel.Home) [71.211.158.194]:45628 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3029.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2022 02:42:35 -0000 breakpoint_re_set_default is only ever called from breakpoint re_set methods, so make it a protected method on code_breakpoint. --- gdb/breakpoint.c | 18 ++++++++---------- gdb/breakpoint.h | 5 +++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index ed932a19ed7..cc0d527fd30 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -87,8 +87,6 @@ static void map_breakpoint_numbers (const char *, gdb::function_view); -static void breakpoint_re_set_default (code_breakpoint *); - static void create_sals_from_location_default (struct event_location *location, struct linespec_result *canonical); @@ -11496,7 +11494,7 @@ code_breakpoint::re_set () return; } - breakpoint_re_set_default (this); + re_set_default (); } int @@ -11932,7 +11930,7 @@ tracepoint_probe_create_sals_from_location void dprintf_breakpoint::re_set () { - breakpoint_re_set_default (this); + re_set_default (); /* extra_string should never be non-NULL for dprintf. */ gdb_assert (extra_string != NULL); @@ -12708,28 +12706,28 @@ location_to_sals (struct breakpoint *b, struct event_location *location, breakpoints. Reevaluate the breakpoint and recreate its locations. */ -static void -breakpoint_re_set_default (code_breakpoint *b) +void +code_breakpoint::re_set_default () { struct program_space *filter_pspace = current_program_space; std::vector expanded, expanded_end; int found; - std::vector sals = location_to_sals (b, b->location.get (), + std::vector sals = location_to_sals (this, location.get (), filter_pspace, &found); if (found) expanded = std::move (sals); - if (b->location_range_end != NULL) + if (location_range_end != NULL) { std::vector sals_end - = location_to_sals (b, b->location_range_end.get (), + = location_to_sals (this, location_range_end.get (), filter_pspace, &found); if (found) expanded_end = std::move (sals_end); } - update_breakpoint_locations (b, filter_pspace, expanded, expanded_end); + update_breakpoint_locations (this, filter_pspace, expanded, expanded_end); } /* Default method for creating SALs from an address string. It basically diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 566f1285e46..4fdd50324e3 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -885,6 +885,11 @@ struct code_breakpoint : public breakpoint std::vector decode_location (struct event_location *location, struct program_space *search_pspace) override; + +protected: + + /* Helper method that does the basic work of re_set. */ + void re_set_default (); }; /* An instance of this type is used to represent a watchpoint, -- 2.34.1