From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id bGjmC2m8r2CtQAAAWB0awg (envelope-from ) for ; Thu, 27 May 2021 11:36:09 -0400 Received: by simark.ca (Postfix, from userid 112) id DE9B21F14C; Thu, 27 May 2021 11:36:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 11A751E01F for ; Thu, 27 May 2021 11:36:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 241F439578CC; Thu, 27 May 2021 15:36:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 241F439578CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622129764; bh=QdRPfE7XGaUp/qUAoTU1x2/3mP7D+gU37IF7UL3LcgE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Lxfh8mE9n0p66WPO2Oo6xOtNlcMp6F0y8fBbegmm2aoAKt/NcKFOqM6P2bbHKlGRm 9Rb+O2G92fcvl819S0yXz9CCrTCGLtr6OOfIZeRT0JzrUsnYfSIzHB+HRZAeuSwr79 640Y5lLvFcifw/WENIL8HRPopinkEo5KiQd7qf9E= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id D137B395587B for ; Thu, 27 May 2021 15:36:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D137B395587B X-ASG-Debug-ID: 1622129759-0c856e6cd514dd890001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id XMYCOPCdxYHc75Cr (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 May 2021 11:35:59 -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 84F36441D64; Thu, 27 May 2021 11:35:59 -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 0/9] Convert breakpoint iteration macros to ranges Date: Thu, 27 May 2021 11:35:49 -0400 X-ASG-Orig-Subj: [PATCH 0/9] Convert breakpoint iteration macros to ranges Message-Id: <20210527153558.3016335-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1622129759 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1756 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" This all started with me finding that the update_global_location_list function was hard to read, notably because the breakpoint iteration macros are a bit hard to read (require multiple local variables and pointers to pointers). So this removes all breakpoint-related iteration macros in favor of functions that return iterable ranges. Patch 5 also converts the bp_locations array into a vector, which simplifies things a bit. In the end, the update_global_location_list is still hard to understand (big surprise), but I think that the code in general is a bit tidier like this. I regtested this on Linux, with the unix and native-extended-gdbserver boards. Simon Marchi (9): gdb: add all_breakpoints function gdb: add all_breakpoints_safe function gdb: add all_tracepoints function gdb: add breakpoint::locations method gdb: make bp_locations an std::vector gdb: add all_bp_locations function gdb: add all_bp_locations_at_addr function gdb: remove iterate_over_breakpoints function gdb: remove iterate_over_bp_locations function gdb/ada-lang.c | 4 +- gdb/breakpoint.c | 866 +++++++++++-------------------- gdb/breakpoint.h | 69 ++- gdb/dummy-frame.c | 7 +- gdb/guile/scm-breakpoint.c | 10 +- gdb/jit.c | 2 +- gdb/python/py-breakpoint.c | 27 +- gdb/python/py-finishbreakpoint.c | 17 +- gdb/record-full.c | 26 +- gdb/remote.c | 3 +- gdb/solib-svr4.c | 7 +- gdb/tracepoint.c | 31 +- gdb/tui/tui-winsource.c | 9 +- 13 files changed, 420 insertions(+), 658 deletions(-) -- 2.31.1