From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from qproxy2-pub.mail.unifiedlayer.com (qproxy2-pub.mail.unifiedlayer.com [69.89.16.161]) by sourceware.org (Postfix) with ESMTPS id F1C573857348 for ; Sat, 28 May 2022 02:43:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F1C573857348 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 gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by qproxy2.mail.unifiedlayer.com (Postfix) with ESMTP id 45DB98048D20 for ; Sat, 28 May 2022 02:43:04 +0000 (UTC) Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id 0925F100478B7 for ; Sat, 28 May 2022 02:42:34 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id umPRn4xrDQs3CumPRn72J8; Sat, 28 May 2022 02:42:34 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=A+Opg4aG c=1 sm=1 tr=0 ts=62918c1a 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=cj6jnj2GFHUWeTaHT3sA: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=h8aAxPq7156x9bzzxF/NEC/T0OcBqDsgJgkEunF6/Vc=; b=P6yzeb+VHrYHVfjlj5J9lmnFFw QXuO1hw3urjJdRubnIJT0Q/H3aUKRRTHJsWqFi+aqn6DQ5OIqoVBGaIorivDzZFbOpgDzSaajlvKj JAO+NPSBTeSnrgk8iwJk5+Q72; 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 1numPR-003NVE-Ds; Fri, 27 May 2022 20:42:33 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/3] Move decode_location to code_breakpoint Date: Fri, 27 May 2022 20:42:31 -0600 Message-Id: <20220528024231.474534-4-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: 1numPR-003NVE-Ds 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: 4 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, 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:43:06 -0000 breakpoint::decode_location just asserts if called. It turned out to be relatively easy to remove this method from breakpoint and instead move the base implementation to code_breakpoint. --- gdb/breakpoint.c | 7 ------- gdb/breakpoint.h | 23 ++++++++++------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index ee34733e6cd..8c6507ae9fd 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -11474,13 +11474,6 @@ breakpoint::print_recreate (struct ui_file *fp) const internal_error_pure_virtual_called (); } -std::vector -breakpoint::decode_location (struct event_location *location, - struct program_space *search_pspace) -{ - internal_error_pure_virtual_called (); -} - /* Default breakpoint_ops methods. */ void diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 5ce6edf6efc..663c939c162 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -709,16 +709,6 @@ struct breakpoint /* Print to FP the CLI command that recreates this breakpoint. */ virtual void print_recreate (struct ui_file *fp) const; - /* Given the location (second parameter), this method decodes it and - returns the SAL locations related to it. For ordinary - breakpoints, it calls `decode_line_full'. If SEARCH_PSPACE is - not NULL, symbol search is restricted to just that program space. - - This function is called inside `location_to_sals'. */ - virtual std::vector decode_location - (struct event_location *location, - struct program_space *search_pspace); - /* Return true if this breakpoint explains a signal. See bpstat_explains_signal. */ virtual bool explains_signal (enum gdb_signal) @@ -882,12 +872,19 @@ struct code_breakpoint : public breakpoint const address_space *aspace, CORE_ADDR bp_addr, const target_waitstatus &ws) override; - std::vector decode_location - (struct event_location *location, - struct program_space *search_pspace) override; protected: + /* Given the location (second parameter), this method decodes it and + returns the SAL locations related to it. For ordinary + breakpoints, it calls `decode_line_full'. If SEARCH_PSPACE is + not NULL, symbol search is restricted to just that program space. + + This function is called inside `location_to_sals'. */ + virtual std::vector decode_location + (struct event_location *location, + struct program_space *search_pspace); + /* Helper method that does the basic work of re_set. */ void re_set_default (); -- 2.34.1