From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by sourceware.org (Postfix) with ESMTPS id 4CDA53857828 for ; Tue, 18 Jan 2022 19:40:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4CDA53857828 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 progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id BDB5210048A1A for ; Tue, 18 Jan 2022 19:40:24 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id 9uLAnhezEXOyf9uLAneduC; Tue, 18 Jan 2022 19:40:24 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=Ot6Kdwzt c=1 sm=1 tr=0 ts=61e717a8 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=DghFqjY3_ZEA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=X2kh5iDFkjd3CqflVVcA: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=PcfwCvhZ7DsCTkkj/mUOJabAHIEMGKvs9NtxTFh+XVk=; b=Zx6tL959i6xdmq0/mpiRmKhBQT qqVj5RGnweFZxG1rlm7eZeewVY9HbuQAQaoLpE8OuzaMQJIXwQ1c3Gel2brzcFtSZ2hUumUaSekok pRgUqpmh4QzvjLpg5/qyDp0Wk; Received: from 75-166-134-30.hlrn.qwest.net ([75.166.134.30]:40588 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 1n9uL9-0015df-5M; Tue, 18 Jan 2022 12:40:23 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 35/36] Remove allocate_bp_location Date: Tue, 18 Jan 2022 12:40:06 -0700 Message-Id: <20220118194007.2853108-36-tom@tromey.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220118194007.2853108-1-tom@tromey.com> References: <20220118194007.2853108-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: 75.166.134.30 X-Source-L: No X-Exim-ID: 1n9uL9-0015df-5M X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-134-30.hlrn.qwest.net (prentzel.Home) [75.166.134.30]:40588 X-Source-Auth: tom+tromey.com X-Email-Count: 36 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3031.3 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 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 18 Jan 2022 19:40:26 -0000 allocate_bp_location is just a small wrapper for a method call, so inline it everywhere. --- gdb/breakpoint.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 009ca88dbdb..587344d6d74 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -175,8 +175,6 @@ static void enable_breakpoint_disp (struct breakpoint *, enum bpdisp, static void decref_bp_location (struct bp_location **loc); -static struct bp_location *allocate_bp_location (struct breakpoint *bpt); - static std::vector bkpt_probe_decode_location (struct breakpoint *b, struct event_location *location, @@ -1829,7 +1827,7 @@ software_watchpoint_add_no_memory_location (struct breakpoint *b, { gdb_assert (b->type == bp_watchpoint && b->loc == NULL); - b->loc = allocate_bp_location (b); + b->loc = b->allocate_location (); b->loc->pspace = pspace; b->loc->address = -1; b->loc->length = -1; @@ -2082,7 +2080,7 @@ update_watchpoint (struct watchpoint *b, int reparse) else if (b->type == bp_access_watchpoint) type = hw_access; - loc = allocate_bp_location (b); + loc = b->allocate_location (); for (tmp = &(b->loc); *tmp != NULL; tmp = &((*tmp)->next)) ; *tmp = loc; @@ -7137,14 +7135,6 @@ bp_location::bp_location (breakpoint *owner) { } -/* Allocate a struct bp_location. */ - -static struct bp_location * -allocate_bp_location (struct breakpoint *bpt) -{ - return bpt->allocate_location (); -} - /* Decrement reference count. If the reference count reaches 0, destroy the bp_location. Sets *BLP to NULL. */ @@ -7975,7 +7965,7 @@ momentary_breakpoint_from_master (struct breakpoint *orig, struct breakpoint *copy; copy = set_raw_breakpoint_without_location (orig->gdbarch, type, ops); - copy->loc = allocate_bp_location (copy); + copy->loc = copy->allocate_location (); set_breakpoint_location_function (copy->loc); copy->loc->gdbarch = orig->loc->gdbarch; @@ -8107,7 +8097,7 @@ add_location_to_breakpoint (struct breakpoint *b, loc_gdbarch = b->gdbarch; /* Adjust the breakpoint's address prior to allocating a location. - Once we call allocate_bp_location(), that mostly uninitialized + Once we call allocate_location(), that mostly uninitialized location will be placed on the location chain. Adjustment of the breakpoint may cause target_read_memory() to be called and we do not want its scan of the location chain to find a breakpoint and @@ -8116,7 +8106,7 @@ add_location_to_breakpoint (struct breakpoint *b, sal->pc, b->type); /* Sort the locations by their ADDRESS. */ - loc = allocate_bp_location (b); + loc = b->allocate_location (); for (tmp = &(b->loc); *tmp != NULL && (*tmp)->address <= adjusted_address; tmp = &((*tmp)->next)) ; -- 2.31.1