From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cL8YIWk5KWcr0iUAWB0awg (envelope-from ) for ; Mon, 04 Nov 2024 16:15:21 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=uGdW/PD0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 812B81E5E0; Mon, 4 Nov 2024 16:15:21 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.5 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8B1EF1E0C0 for ; Mon, 4 Nov 2024 16:15:20 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43D843857350 for ; Mon, 4 Nov 2024 21:15:20 +0000 (GMT) Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id C94D0385842D for ; Mon, 4 Nov 2024 21:14:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C94D0385842D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C94D0385842D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730754867; cv=none; b=NN8SYYJ4zYYT+SX1X2lhKRgoZGlqScv5Q72bIfBfBeEpdBumomQoBgBqAqiHc5s8YaL2bQKGbq/jrZ3Vs7qBtxNJrRH99fYKUmERRjCm+23ECu2txvT5tItnweBs8WV5wnJfvKHkhohDIg3XicupaufXLF7sei/WWfHy21T0008= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730754867; c=relaxed/simple; bh=yIfD/bWlDJM8hm7zTpvaxZe5ZgOyVpvwCM/huLRRFC4=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=Rg5qC4O/o4PC6wsDycvMC6olxXLiubcGyMjhzI1u9dIDaLFldigdRYhL/eU9qvL4m2RNPEb395fvSB6YIL2Enz/XxfABbKEhMdTy6j5q+mF/lloDNM4cISCulgZy1ie/qDF+qumTUTPLhfsrNV86MdtB4yP7jQDQghEzlds56So= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id 7ox7t29fvg2lz84OutDb5U; Mon, 04 Nov 2024 21:14:16 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 84OttaxFtrfWs84Ott8p93; Mon, 04 Nov 2024 21:14:15 +0000 X-Authority-Analysis: v=2.4 cv=R5oFG8RX c=1 sm=1 tr=0 ts=67293927 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=VlfZXiiP6vEA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=sK0pUeBVLe8VggHfOg4A:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=KLbSGB2kZsQ3O4D7U7xM3z6I0Rm+RVLJGuwOETi0F84=; b=uGdW/PD01+g1lx3ArtADJPvhFG wN6V5KOlWIIOBXGI+Yg69w009NrYQJ0dKFspqS8hyk2MFQtbv5MKkXWfKoHhlL89jHDnDFbBkInde CrVnLFWDa8jG/fHbyMomWB3EQ; Received: from 97-122-113-155.hlrn.qwest.net ([97.122.113.155]:36924 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1t84Os-003uOz-2T; Mon, 04 Nov 2024 14:14:14 -0700 From: Tom Tromey Date: Mon, 04 Nov 2024 14:14:14 -0700 Subject: [PATCH 4/6] Remove skip_permanent_breakpoint gdbarch hook MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20241104-check-unused-gdbarch-v1-4-7082f2121077@tromey.com> References: <20241104-check-unused-gdbarch-v1-0-7082f2121077@tromey.com> In-Reply-To: <20241104-check-unused-gdbarch-v1-0-7082f2121077@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey , Jan Kratochvil X-Mailer: b4 0.14.2 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: 97.122.113.155 X-Source-L: No X-Exim-ID: 1t84Os-003uOz-2T X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-113-155.hlrn.qwest.net (prentzel.local) [97.122.113.155]:36924 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfIV2sT9j4JNgXyqbVl5qtg0BSnv/6vmvfDGVLSeIa36aH551apbNgItJ2nWrn9L27MrqwCODVrWmdpuYP8mjjs+1ChPeFQ/wNwzRIGdYUABT/LrYFy+c uxK9X6lK+kFvdw/2DSnSAax+JQV34OUnvmurpeFgSJrn5X9MLG6AJSQtcdIAGSFix+4ZTl4UaXZsbOcONxkFaagYC2SyV3FUCWw= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org The skip_permanent_breakpoint gdbarch hook has been obsolete since: commit 61a12cfa7b25746914493cc0d94e5053a8492aa5 Author: Jan Kratochvil Date: Fri Mar 13 20:24:22 2015 +0100 Remove HPUX This patch removes it. --- gdb/arch-utils.c | 12 ------------ gdb/arch-utils.h | 7 ------- gdb/breakpoint.c | 3 +-- gdb/breakpoint.h | 3 +-- gdb/gdbarch-gen.c | 22 ---------------------- gdb/gdbarch-gen.h | 6 ------ gdb/gdbarch_components.py | 11 ----------- gdb/infrun.c | 7 ++++--- 8 files changed, 6 insertions(+), 65 deletions(-) diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 6ffa4109765579bc6654df8ae245a26cdcad838f..6ca9ec34ad8a6f1fc77e576a475b3bd3182fa265 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -956,18 +956,6 @@ default_program_breakpoint_here_p (struct gdbarch *gdbarch, return false; } -void -default_skip_permanent_breakpoint (struct regcache *regcache) -{ - struct gdbarch *gdbarch = regcache->arch (); - CORE_ADDR current_pc = regcache_read_pc (regcache); - int bp_len; - - gdbarch_breakpoint_from_pc (gdbarch, ¤t_pc, &bp_len); - current_pc += bp_len; - regcache_write_pc (regcache, current_pc); -} - CORE_ADDR default_infcall_mmap (CORE_ADDR size, unsigned prot) { diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 40c62f30a65fbf86a1644ae24ef3f6ec329fd87f..39094a0bf3e2e121c7df67a64d530ca6c471f661 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -254,13 +254,6 @@ extern bool default_program_breakpoint_here_p (struct gdbarch *gdbarch, extern int default_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range); -/* Default way to advance the PC to the next instruction in order to - skip a permanent breakpoint. Increments the PC by the size of a - software breakpoint instruction, as determined with - gdbarch_breakpoint_from_pc. This matches how the breakpoints - module determines whether a breakpoint is permanent. */ -extern void default_skip_permanent_breakpoint (struct regcache *regcache); - /* Symbols for gdbarch_infcall_mmap; their Linux PROT_* system definitions would be dependent on compilation host. */ #define GDB_MMAP_PROT_READ 0x1 /* Page can be read. */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index b7e4f5d0a4549d4b1729a507419d611ddc7999fa..5b7633e313b1b0b8d91c550cfa86c4ec09d64704 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4411,8 +4411,7 @@ breakpoint_init_inferior (inferior *inf, inf_context context) - When continuing from a location with an ordinary breakpoint, we actually single step once before calling insert_breakpoints. - When continuing from a location with a permanent breakpoint, we - need to use the `SKIP_PERMANENT_BREAKPOINT' macro, provided by - the target, to advance the PC past the breakpoint. */ + advance the PC past the breakpoint manually. */ enum breakpoint_here breakpoint_here_p (const address_space *aspace, CORE_ADDR pc) diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index cef1d727ed256eed919914646e40a2fa06715ec8..5de2efb7398e255fcb7b0c016e87c32c4c9c942c 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -406,8 +406,7 @@ class bp_location : public refcounted_object, public intrusive_list_nodevbit_in_delta)); - gdb_printf (file, - "gdbarch_dump: skip_permanent_breakpoint = <%s>\n", - host_address_to_string (gdbarch->skip_permanent_breakpoint)); gdb_printf (file, "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n", gdbarch_max_insn_length_p (gdbarch)); @@ -4035,23 +4030,6 @@ set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, gdbarch->vbit_in_delta = vbit_in_delta; } -void -gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache) -{ - gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->skip_permanent_breakpoint != NULL); - if (gdbarch_debug >= 2) - gdb_printf (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n"); - gdbarch->skip_permanent_breakpoint (regcache); -} - -void -set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, - gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint) -{ - gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint; -} - bool gdbarch_max_insn_length_p (struct gdbarch *gdbarch) { diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index 0a5a168f21070b5f3baefee217eb6838791a71bb..6b5ebcc28516f942ffa33c288e5d6c1aab7d9aac 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -1054,12 +1054,6 @@ extern void set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, in extern int gdbarch_vbit_in_delta (struct gdbarch *gdbarch); extern void set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, int vbit_in_delta); -/* Advance PC to next instruction in order to skip a permanent breakpoint. */ - -typedef void (gdbarch_skip_permanent_breakpoint_ftype) (struct regcache *regcache); -extern void gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache); -extern void set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint); - /* The maximum length of an instruction on this architecture in bytes. */ extern bool gdbarch_max_insn_length_p (struct gdbarch *gdbarch); diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py index 262d448b6c7130728f21afd4b55c9412553a32fb..f79d61559b8e4c50a66258284376f454072f4112 100644 --- a/gdb/gdbarch_components.py +++ b/gdb/gdbarch_components.py @@ -1779,17 +1779,6 @@ significant bit of the pfn for pointers to virtual member functions. invalid=False, ) -Function( - comment=""" -Advance PC to next instruction in order to skip a permanent breakpoint. -""", - type="void", - name="skip_permanent_breakpoint", - params=[("struct regcache *", "regcache")], - predefault="default_skip_permanent_breakpoint", - invalid=False, -) - Value( comment=""" The maximum length of an instruction on this architecture in bytes. diff --git a/gdb/infrun.c b/gdb/infrun.c index 4ca15450afe0344f9acf97ca73dcf837879650e3..7ac57c4273b4b745ab625a8b6021e775c90ec83e 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2770,10 +2770,11 @@ resume_1 (enum gdb_signal sig) /* There's no signal to pass, we can go ahead and skip the permanent breakpoint manually. */ infrun_debug_printf ("skipping permanent breakpoint"); - gdbarch_skip_permanent_breakpoint (gdbarch, regcache); - /* Update pc to reflect the new address from which we will - execute instructions. */ pc = regcache_read_pc (regcache); + int bp_len; + gdbarch_breakpoint_from_pc (gdbarch, &pc, &bp_len); + pc += bp_len; + regcache_write_pc (regcache, pc); if (step) { -- 2.46.1