From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy4-pub.mail.unifiedlayer.com (gproxy4-pub.mail.unifiedlayer.com [69.89.23.142]) by sourceware.org (Postfix) with ESMTPS id 206B43854830 for ; Thu, 29 Sep 2022 23:35:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 206B43854830 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 cmgw15.mail.unifiedlayer.com (unknown [10.0.90.130]) by progateway6.mail.pro1.eigbox.com (Postfix) with ESMTP id 23F5610048AC8 for ; Thu, 29 Sep 2022 23:35:34 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id e341obQbqrva0e341oAU0C; Thu, 29 Sep 2022 23:35:34 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=I7Wg+Psg c=1 sm=1 tr=0 ts=63362bc6 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=xOM3xZuef0cA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=wVIIVyKAApYPNSBG_bAA: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: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=a3vdAXrbHNGisbfQis/oFPe3liSE0zuUQ40CXLW2LqE=; b=fer9wh0OGUFiasbQnZn81BEEm2 +vo3ZLTrxqijMYUqDAIUM6mNQb9OuVODwLj6KDOPRkOwJt7ADtA/4rVG/IXUOIB7Wc1YEqRG+Np2e 3EnNbiSx2RhG+8WDhGXnwD8Ye; Received: from c-98-245-160-18.hsd1.co.comcast.net ([98.245.160.18]:49492 helo=prentzel.lan) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oe340-0041KO-W1; Thu, 29 Sep 2022 17:35:33 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Remove decode_location_spec_default Date: Thu, 29 Sep 2022 17:35:26 -0600 Message-Id: <20220929233526.1283953-1-tom@tromey.com> X-Mailer: git-send-email 2.34.3 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: 98.245.160.18 X-Source-L: No X-Exim-ID: 1oe340-0041KO-W1 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: c-98-245-160-18.hsd1.co.comcast.net (prentzel.lan) [98.245.160.18]:49492 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3028.9 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 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: Thu, 29 Sep 2022 23:35:53 -0000 This removes decode_location_spec_default, inlining it into its sole caller. Regression tested on x86-64 Fedora 34. --- gdb/breakpoint.c | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 002f4a935b1..c8c34120aa0 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -100,10 +100,6 @@ static void create_breakpoints_sal (struct gdbarch *, int, int, int, int, unsigned); -static std::vector decode_location_spec_default - (struct breakpoint *b, struct location_spec *locspec, - struct program_space *search_pspace); - static int can_use_hardware_watchpoint (const std::vector &vals); @@ -11692,7 +11688,21 @@ code_breakpoint::decode_location_spec (location_spec *locspec, if (locspec->type () == PROBE_LOCATION_SPEC) return bkpt_probe_decode_location_spec (this, locspec, search_pspace); - return decode_location_spec_default (this, locspec, search_pspace); + struct linespec_result canonical; + + decode_line_full (locspec, DECODE_LINE_FUNFIRSTLINE, search_pspace, + NULL, 0, &canonical, multiple_symbols_all, + filter.get ()); + + /* We should get 0 or 1 resulting SALs. */ + gdb_assert (canonical.lsals.size () < 2); + + if (!canonical.lsals.empty ()) + { + const linespec_sals &lsal = canonical.lsals[0]; + return std::move (lsal.sals); + } + return {}; } /* Virtual table for internal breakpoints. */ @@ -12750,31 +12760,6 @@ create_sals_from_location_spec_default (location_spec *locspec, parse_breakpoint_sals (locspec, canonical); } -/* Decode the line represented by S by calling decode_line_full. This is the - default function for the `decode_location' method of breakpoint_ops. */ - -static std::vector -decode_location_spec_default (struct breakpoint *b, - location_spec *locspec, - program_space *search_pspace) -{ - struct linespec_result canonical; - - decode_line_full (locspec, DECODE_LINE_FUNFIRSTLINE, search_pspace, - NULL, 0, &canonical, multiple_symbols_all, - b->filter.get ()); - - /* We should get 0 or 1 resulting SALs. */ - gdb_assert (canonical.lsals.size () < 2); - - if (!canonical.lsals.empty ()) - { - const linespec_sals &lsal = canonical.lsals[0]; - return std::move (lsal.sals); - } - return {}; -} - /* Reset a breakpoint. */ static void -- 2.34.3