From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id V/G/BN28r2D2QAAAWB0awg (envelope-from ) for ; Thu, 27 May 2021 11:38:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 083221E01F; Thu, 27 May 2021 11:38:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 67D481E01F for ; Thu, 27 May 2021 11:38:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0EE77395704C; Thu, 27 May 2021 15:38:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EE77395704C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622129884; bh=aQ2t9isL5QzqVo9f0RTZZlbC6IDSnKFY2qBAQggHwgw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=sC5MFn+SiD5hrYYU38VlmmZKXBhg5GmwTjtxSq62exxK9kvjb5vmueVY0nXfjk6R9 xMsnk4/uXKWH5OljuLTZrFRiRUfMIpeCHkS9Pu7MYpPEbtcEbEeIw/VtUy2NJ6uDlJ jO3LavenORXsJ6EZqEo2oeoG9rHeeQk75MWWYz24= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 2ABA53857C7E for ; Thu, 27 May 2021 15:38:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2ABA53857C7E X-ASG-Debug-ID: 1622129880-0c856e6cd514ddbd0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id dEnWxB9S97fsC6E1 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 May 2021 11:38:00 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 5B278441D64; Thu, 27 May 2021 11:38:00 -0400 (EDT) X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 9/9] gdb: remove iterate_over_bp_locations function Date: Thu, 27 May 2021 11:35:58 -0400 X-ASG-Orig-Subj: [PATCH 9/9] gdb: remove iterate_over_bp_locations function Message-Id: <20210527153558.3016335-10-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210527153558.3016335-1-simon.marchi@polymtl.ca> References: <20210527153558.3016335-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1622129880 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 3712 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.90234 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Remove it, change users (well, a single one) to use all_bp_locations. This requires moving all_bp_locations to breakpoint.h to expose it. gdb/ChangeLog: * breakpoint.h (iterate_over_bp_locations): Remove. Update users to use all_bp_locations. (all_bp_locations): New. * breakpoint.c (all_bp_locations): Make non-static. (iterate_over_bp_locations): Remove. Change-Id: Iaf1f716d6c2c5b2975579b3dc113a86f5d0975be --- gdb/breakpoint.c | 13 +++---------- gdb/breakpoint.h | 7 ++++--- gdb/record-full.c | 26 ++++++++++---------------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 751ed51cc7d3..225294f2bb26 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -521,7 +521,9 @@ all_tracepoints () static std::vector bp_locations; -static const std::vector & +/* See breakpoint.h. */ + +const std::vector & all_bp_locations () { return bp_locations; @@ -2913,15 +2915,6 @@ insert_breakpoints (void) update_global_location_list (UGLL_INSERT); } -/* Invoke CALLBACK for each of bp_location. */ - -void -iterate_over_bp_locations (gdb::function_view callback) -{ - for (bp_location *loc : all_bp_locations ()) - callback (loc); -} - /* This is used when we need to synch breakpoint conditions between GDB and the target. It is the case with deleting and disabling of breakpoints when using always-inserted mode. */ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index ffe042459eef..e40504f14ed3 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1313,9 +1313,6 @@ extern void breakpoint_init_inferior (enum inf_context); extern void breakpoint_auto_delete (bpstat); -extern void iterate_over_bp_locations - (gdb::function_view callback); - /* Return the chain of command lines to execute when this breakpoint is hit. */ extern struct command_line *breakpoint_commands (struct breakpoint *b); @@ -1755,6 +1752,10 @@ using tracepoint_range = next_adapter; tracepoint_range all_tracepoints (); +/* Return a range to iterate over all breakpoint locations. */ + +const std::vector &all_bp_locations (); + /* Nonzero if the specified PC cannot be a location where functions have been inlined. */ diff --git a/gdb/record-full.c b/gdb/record-full.c index 91da1076194f..98d48e677443 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1719,21 +1719,6 @@ struct record_full_breakpoint active. */ static std::vector record_full_breakpoints; -static void -record_full_sync_record_breakpoints (struct bp_location *loc) -{ - if (loc->loc_type != bp_loc_software_breakpoint) - return; - - if (loc->inserted) - { - record_full_breakpoints.emplace_back - (loc->target_info.placed_address_space, - loc->target_info.placed_address, - 1); - } -} - /* Sync existing breakpoints to record_full_breakpoints. */ static void @@ -1741,7 +1726,16 @@ record_full_init_record_breakpoints (void) { record_full_breakpoints.clear (); - iterate_over_bp_locations (record_full_sync_record_breakpoints); + for (bp_location *loc : all_bp_locations ()) + { + if (loc->loc_type != bp_loc_software_breakpoint) + continue; + + if (loc->inserted) + record_full_breakpoints.emplace_back + (loc->target_info.placed_address_space, + loc->target_info.placed_address, 1); + } } /* Behavior is conditional on RECORD_FULL_IS_REPLAY. We will not actually -- 2.31.1