From patchwork Fri Dec 1 16:27:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 81151 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B839D386181F for ; Fri, 1 Dec 2023 16:32:29 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 4A5FC3861831 for ; Fri, 1 Dec 2023 16:31:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4A5FC3861831 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4A5FC3861831 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701448323; cv=none; b=S92HPBIZPZWzbzM7wj11zS0JKceabkJC/Rt/CC5hn7q3Vm/8y2LQIgYCJidIReRfv5So3MMsCqEhsugYCJxMpT9/eAiASzftqC7DCvPUVklzr/FAY9EGXEdGQtXrFHtFaPj9FWuzTBejNWwhSna09M4DRyCJNFPRHybjgw5fsOM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701448323; c=relaxed/simple; bh=35xdTsrgNHGk/RYIxrWlLrdSYTr+H0D9CwAYzHIMl2Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=TzLT9abME3P64HzXSkBPfT7i0C/nuoJG3ZvfsZjcxbsQe5n0GxpLD1knhX9L/u+X5EmZ050Fg7e6eQERHLeU2e3R4xnMvVmi4g2ab6m/S0zkdrh04eJHVGELYqwhtP9MYxtiQ16Xf4OYnPxLA6fBPbskZn+v4GtzltgeGspxphg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (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 ESMTPSA id 785C61E091; Fri, 1 Dec 2023 11:31:58 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Luis Machado , John Baldwin , "Aktemur, Tankut Baris" , Simon Marchi , John Baldwin Subject: [PATCH 16/24] gdb: rename gdbarch_pseudo_register_write to gdbarch_deprecated_pseudo_register_write Date: Fri, 1 Dec 2023 11:27:29 -0500 Message-ID: <20231201162751.741751-17-simon.marchi@efficios.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231201162751.741751-1-simon.marchi@efficios.com> References: <20231201162751.741751-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3496.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org The next patch introduces a new variant of gdbarch_pseudo_register_write that takes a frame instead of a regcache for implementations to write raw registers. Rename to old one to make it clear it's deprecated. Change-Id: If8872c89c6f8a1edfcab983eb064248fd5ff3115 Reviewed-By: John Baldwin --- gdb/aarch64-tdep.c | 2 +- gdb/amd64-tdep.c | 4 ++-- gdb/arm-tdep.c | 2 +- gdb/avr-tdep.c | 3 ++- gdb/bfin-tdep.c | 3 ++- gdb/csky-tdep.c | 4 ++-- gdb/frv-tdep.c | 3 ++- gdb/gdbarch-gen.h | 15 +++++++++++---- gdb/gdbarch.c | 30 +++++++++++++++--------------- gdb/gdbarch_components.py | 10 +++++++++- gdb/h8300-tdep.c | 3 ++- gdb/i386-tdep.c | 3 ++- gdb/ia64-tdep.c | 3 ++- gdb/m32c-tdep.c | 3 ++- gdb/m68hc11-tdep.c | 3 ++- gdb/mep-tdep.c | 3 ++- gdb/mips-tdep.c | 3 ++- gdb/msp430-tdep.c | 3 ++- gdb/nds32-tdep.c | 3 ++- gdb/regcache.c | 4 ++-- gdb/riscv-tdep.c | 9 +++++---- gdb/rl78-tdep.c | 3 ++- gdb/rs6000-tdep.c | 4 ++-- gdb/s390-tdep.c | 3 ++- gdb/sh-tdep.c | 9 ++++++--- gdb/sparc-tdep.c | 3 ++- gdb/sparc64-tdep.c | 3 ++- gdb/xtensa-tdep.c | 3 ++- 28 files changed, 90 insertions(+), 54 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index d901b69ce11d..5b2d87be6bfc 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -4481,7 +4481,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_pseudo_regs (gdbarch, num_pseudo_regs); set_gdbarch_pseudo_register_read_value (gdbarch, aarch64_pseudo_read_value); - set_gdbarch_pseudo_register_write (gdbarch, aarch64_pseudo_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, aarch64_pseudo_write); set_tdesc_pseudo_register_name (gdbarch, aarch64_pseudo_register_name); set_tdesc_pseudo_register_type (gdbarch, aarch64_pseudo_register_type); set_tdesc_pseudo_register_reggroup_p (gdbarch, diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 955a6860631d..a0b4986d5b6c 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -3205,8 +3205,8 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, set_gdbarch_pseudo_register_read_value (gdbarch, amd64_pseudo_register_read_value); - set_gdbarch_pseudo_register_write (gdbarch, - amd64_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + amd64_pseudo_register_write); set_gdbarch_ax_pseudo_register_collect (gdbarch, amd64_ax_pseudo_register_collect); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 1ee8bdf46159..85fd37ba73a0 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -10906,7 +10906,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { set_gdbarch_num_pseudo_regs (gdbarch, num_pseudos); set_gdbarch_pseudo_register_read (gdbarch, arm_pseudo_read); - set_gdbarch_pseudo_register_write (gdbarch, arm_pseudo_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, arm_pseudo_write); } /* Add standard register aliases. We add aliases even for those diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index be0601056a80..c0b954c4acc9 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1510,7 +1510,8 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_pseudo_regs (gdbarch, AVR_NUM_PSEUDO_REGS); set_gdbarch_pseudo_register_read (gdbarch, avr_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, avr_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + avr_pseudo_register_write); set_gdbarch_return_value (gdbarch, avr_return_value); diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index 4b9067a2d0f7..0ff4355f573e 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -805,7 +805,8 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, BFIN_NUM_REGS); set_gdbarch_pseudo_register_read (gdbarch, bfin_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, bfin_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + bfin_pseudo_register_write); set_gdbarch_num_pseudo_regs (gdbarch, BFIN_NUM_PSEUDO_REGS); set_gdbarch_sp_regnum (gdbarch, BFIN_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, BFIN_PC_REGNUM); diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index e82b8dff546e..6cca72041a73 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -2872,8 +2872,8 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->fv_pseudo_registers_count); set_gdbarch_pseudo_register_read (gdbarch, csky_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, - csky_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write + (gdbarch, csky_pseudo_register_write); set_tdesc_pseudo_register_name (gdbarch, csky_pseudo_register_name); } diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 6528cf3e405e..7944228a6021 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1499,7 +1499,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_sim_regno (gdbarch, frv_register_sim_regno); set_gdbarch_pseudo_register_read (gdbarch, frv_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, frv_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + frv_pseudo_register_write); set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue); set_gdbarch_skip_main_prologue (gdbarch, frv_skip_main_prologue); diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index c70bfc97634a..7b34dce3cfc8 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -200,11 +200,18 @@ typedef struct value * (gdbarch_pseudo_register_read_value_ftype) (struct gdbarc extern struct value * gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, frame_info_ptr next_frame, int cookednum); extern void set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value); -extern bool gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch); +/* Write bytes to a pseudo register. -typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf); -extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf); -extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write); + This is marked as deprecated because it gets passed a regcache for + implementations to write raw registers in. This doesn't work for unwound + frames, where the raw registers backing the pseudo registers may have been + saved elsewhere. */ + +extern bool gdbarch_deprecated_pseudo_register_write_p (struct gdbarch *gdbarch); + +typedef void (gdbarch_deprecated_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf); +extern void gdbarch_deprecated_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf); +extern void set_gdbarch_deprecated_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_deprecated_pseudo_register_write_ftype *deprecated_pseudo_register_write); extern int gdbarch_num_regs (struct gdbarch *gdbarch); extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 06ff52576bdf..e198d339f6ba 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -74,7 +74,7 @@ struct gdbarch gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer = legacy_virtual_frame_pointer; gdbarch_pseudo_register_read_ftype *pseudo_register_read = nullptr; gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value = nullptr; - gdbarch_pseudo_register_write_ftype *pseudo_register_write = nullptr; + gdbarch_deprecated_pseudo_register_write_ftype *deprecated_pseudo_register_write = nullptr; int num_regs = -1; int num_pseudo_regs = 0; gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect = nullptr; @@ -330,7 +330,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ /* Skip verify of pseudo_register_read, has predicate. */ /* Skip verify of pseudo_register_read_value, has predicate. */ - /* Skip verify of pseudo_register_write, has predicate. */ + /* Skip verify of deprecated_pseudo_register_write, has predicate. */ if (gdbarch->num_regs == -1) log.puts ("\n\tnum_regs"); /* Skip verify of num_pseudo_regs, invalid_p == 0 */ @@ -650,11 +650,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: pseudo_register_read_value = <%s>\n", host_address_to_string (gdbarch->pseudo_register_read_value)); gdb_printf (file, - "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", - gdbarch_pseudo_register_write_p (gdbarch)); + "gdbarch_dump: gdbarch_deprecated_pseudo_register_write_p() = %d\n", + gdbarch_deprecated_pseudo_register_write_p (gdbarch)); gdb_printf (file, - "gdbarch_dump: pseudo_register_write = <%s>\n", - host_address_to_string (gdbarch->pseudo_register_write)); + "gdbarch_dump: deprecated_pseudo_register_write = <%s>\n", + host_address_to_string (gdbarch->deprecated_pseudo_register_write)); gdb_printf (file, "gdbarch_dump: num_regs = %s\n", plongest (gdbarch->num_regs)); @@ -1903,27 +1903,27 @@ set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, } bool -gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch) +gdbarch_deprecated_pseudo_register_write_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->pseudo_register_write != NULL; + return gdbarch->deprecated_pseudo_register_write != NULL; } void -gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf) +gdbarch_deprecated_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf) { gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->pseudo_register_write != NULL); + gdb_assert (gdbarch->deprecated_pseudo_register_write != NULL); if (gdbarch_debug >= 2) - gdb_printf (gdb_stdlog, "gdbarch_pseudo_register_write called\n"); - gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf); + gdb_printf (gdb_stdlog, "gdbarch_deprecated_pseudo_register_write called\n"); + gdbarch->deprecated_pseudo_register_write (gdbarch, regcache, cookednum, buf); } void -set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, - gdbarch_pseudo_register_write_ftype pseudo_register_write) +set_gdbarch_deprecated_pseudo_register_write (struct gdbarch *gdbarch, + gdbarch_deprecated_pseudo_register_write_ftype deprecated_pseudo_register_write) { - gdbarch->pseudo_register_write = pseudo_register_write; + gdbarch->deprecated_pseudo_register_write = deprecated_pseudo_register_write; } int diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py index c597b38ad5a9..ee3fd2b69454 100644 --- a/gdb/gdbarch_components.py +++ b/gdb/gdbarch_components.py @@ -419,8 +419,16 @@ never be called. ) Method( + comment=""" +Write bytes to a pseudo register. + +This is marked as deprecated because it gets passed a regcache for +implementations to write raw registers in. This doesn't work for unwound +frames, where the raw registers backing the pseudo registers may have been +saved elsewhere. +""", type="void", - name="pseudo_register_write", + name="deprecated_pseudo_register_write", params=[ ("struct regcache *", "regcache"), ("int", "cookednum"), diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index d1494916f594..20f503c209bf 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1318,7 +1318,8 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } set_gdbarch_pseudo_register_read (gdbarch, h8300_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, h8300_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + h8300_pseudo_register_write); /* * Basic register fields and methods. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index be1aa83bbbdb..228b390245f6 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8678,7 +8678,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Pseudo registers may be changed by amd64_init_abi. */ set_gdbarch_pseudo_register_read_value (gdbarch, i386_pseudo_register_read_value); - set_gdbarch_pseudo_register_write (gdbarch, i386_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + i386_pseudo_register_write); set_gdbarch_ax_pseudo_register_collect (gdbarch, i386_ax_pseudo_register_collect); diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index b009b46ef6df..699959a8bf0b 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3959,7 +3959,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, ia64_register_type); set_gdbarch_pseudo_register_read (gdbarch, ia64_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, ia64_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + ia64_pseudo_register_write); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, ia64_dwarf_reg_to_regnum); set_gdbarch_register_reggroup_p (gdbarch, ia64_register_reggroup_p); set_gdbarch_convert_register_p (gdbarch, ia64_convert_register_p); diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index a0f1779c41b0..3efeb0032e76 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -977,7 +977,8 @@ make_regs (struct gdbarch *arch) set_gdbarch_register_name (arch, m32c_register_name); set_gdbarch_register_type (arch, m32c_register_type); set_gdbarch_pseudo_register_read (arch, m32c_pseudo_register_read); - set_gdbarch_pseudo_register_write (arch, m32c_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (arch, + m32c_pseudo_register_write); set_gdbarch_register_sim_regno (arch, m32c_register_sim_regno); set_gdbarch_stab_reg_to_regnum (arch, m32c_debug_info_reg_to_regnum); set_gdbarch_dwarf2_reg_to_regnum (arch, m32c_debug_info_reg_to_regnum); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 1257c55ce667..668158f15a09 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1491,7 +1491,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_register_name (gdbarch, m68hc11_register_name); set_gdbarch_register_type (gdbarch, m68hc11_register_type); set_gdbarch_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + m68hc11_pseudo_register_write); set_gdbarch_push_dummy_call (gdbarch, m68hc11_push_dummy_call); diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 6210b929f9d0..ad630d60bf1e 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2424,7 +2424,8 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, mep_register_type); set_gdbarch_num_pseudo_regs (gdbarch, MEP_NUM_PSEUDO_REGS); set_gdbarch_pseudo_register_read (gdbarch, mep_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, mep_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + mep_pseudo_register_write); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mep_debug_reg_to_regnum); set_gdbarch_stab_reg_to_regnum (gdbarch, mep_debug_reg_to_regnum); diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index fc3193ea27a5..8749c7c9eeaf 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -8518,7 +8518,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_register_reggroup_p (gdbarch, mips_register_reggroup_p); set_gdbarch_pseudo_register_read (gdbarch, mips_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, mips_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + mips_pseudo_register_write); set_gdbarch_ax_pseudo_register_collect (gdbarch, mips_ax_pseudo_register_collect); diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index c03e12c9486f..cc2ac4d2621f 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -937,7 +937,8 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sp_regnum (gdbarch, MSP430_SP_REGNUM); set_gdbarch_register_reggroup_p (gdbarch, msp430_register_reggroup_p); set_gdbarch_pseudo_register_read (gdbarch, msp430_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, msp430_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + msp430_pseudo_register_write); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, msp430_dwarf2_reg_to_regnum); set_gdbarch_register_sim_regno (gdbarch, msp430_register_sim_regno); diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index 7618a81fc256..83685d06f3ee 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -2001,7 +2001,8 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) else if (use_pseudo_fsrs == 1) { set_gdbarch_pseudo_register_read (gdbarch, nds32_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, nds32_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write + (gdbarch, nds32_pseudo_register_write); set_tdesc_pseudo_register_name (gdbarch, nds32_pseudo_register_name); set_tdesc_pseudo_register_type (gdbarch, nds32_pseudo_register_type); set_gdbarch_num_pseudo_regs (gdbarch, num_fsr_map[fpu_freg]); diff --git a/gdb/regcache.c b/gdb/regcache.c index 9575988760ba..0e3316aaa096 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -912,8 +912,8 @@ regcache::cooked_write (int regnum, gdb::array_view src) if (regnum < num_raw_registers ()) raw_write (regnum, src); else - gdbarch_pseudo_register_write (m_descr->gdbarch, this, regnum, - src.data ()); + gdbarch_deprecated_pseudo_register_write (m_descr->gdbarch, this, regnum, + src.data ()); } /* See regcache.h. */ diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 8110a8deedbf..4c129a66652f 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1002,9 +1002,9 @@ riscv_pseudo_register_read (struct gdbarch *gdbarch, return REG_UNKNOWN; } -/* Implement gdbarch_pseudo_register_write. Write the contents of BUF into - pseudo-register REGNUM in REGCACHE. BUF is sized based on the type of - register REGNUM. */ +/* Implement gdbarch_deprecated_pseudo_register_write. Write the contents of + BUF into pseudo-register REGNUM in REGCACHE. BUF is sized based on the type + of register REGNUM. */ static void riscv_pseudo_register_write (struct gdbarch *gdbarch, @@ -4229,7 +4229,8 @@ riscv_gdbarch_init (struct gdbarch_info info, set_tdesc_pseudo_register_reggroup_p (gdbarch, riscv_pseudo_register_reggroup_p); set_gdbarch_pseudo_register_read (gdbarch, riscv_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, riscv_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + riscv_pseudo_register_write); /* Finalise the target description registers. */ tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data), diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index 2f40fbddaa1e..19298063186f 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -1436,7 +1436,8 @@ rl78_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, RL78_PC_REGNUM); set_gdbarch_sp_regnum (gdbarch, RL78_SP_REGNUM); set_gdbarch_pseudo_register_read (gdbarch, rl78_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, rl78_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + rl78_pseudo_register_write); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, rl78_dwarf_reg_to_regnum); set_gdbarch_register_reggroup_p (gdbarch, rl78_register_reggroup_p); set_gdbarch_register_sim_regno (gdbarch, rl78_register_sim_regno); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 643997e5bd7d..a7e0bf5305b5 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -8353,8 +8353,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) || have_vsx || have_htm_fpu || have_htm_vsx) { set_gdbarch_pseudo_register_read (gdbarch, rs6000_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, - rs6000_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write + (gdbarch, rs6000_pseudo_register_write); set_gdbarch_ax_pseudo_register_collect (gdbarch, rs6000_ax_pseudo_register_collect); } diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 5b58cb382e30..fcba7a1a5608 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -7081,7 +7081,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Pseudo registers. */ set_gdbarch_pseudo_register_read (gdbarch, s390_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, s390_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + s390_pseudo_register_write); set_tdesc_pseudo_register_name (gdbarch, s390_pseudo_register_name); set_tdesc_pseudo_register_type (gdbarch, s390_pseudo_register_type); set_tdesc_pseudo_register_reggroup_p (gdbarch, diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index babf85eeb906..ae1ce1e44713 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -2286,7 +2286,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp0_regnum (gdbarch, 25); set_gdbarch_num_pseudo_regs (gdbarch, 9); set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + sh_pseudo_register_write); set_gdbarch_return_value (gdbarch, sh_return_value_fpu); set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu); break; @@ -2297,7 +2298,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_pseudo_regs (gdbarch, 1); set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + sh_pseudo_register_write); break; case bfd_mach_sh_dsp: @@ -2337,7 +2339,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp0_regnum (gdbarch, 25); set_gdbarch_num_pseudo_regs (gdbarch, 13); set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + sh_pseudo_register_write); set_gdbarch_return_value (gdbarch, sh_return_value_fpu); set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu); break; diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 78f240db04e7..3a053a99e351 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1844,7 +1844,8 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_tdesc_pseudo_register_name (gdbarch, sparc32_pseudo_register_name); set_tdesc_pseudo_register_type (gdbarch, sparc32_pseudo_register_type); set_gdbarch_pseudo_register_read (gdbarch, sparc32_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, sparc32_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + sparc32_pseudo_register_write); /* Register numbers of various important registers. */ set_gdbarch_sp_regnum (gdbarch, SPARC_SP_REGNUM); /* %sp */ diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index abbbb73d1db9..61f486689f15 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -1825,7 +1825,8 @@ sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_tdesc_pseudo_register_name (gdbarch, sparc64_pseudo_register_name); set_tdesc_pseudo_register_type (gdbarch, sparc64_pseudo_register_type); set_gdbarch_pseudo_register_read (gdbarch, sparc64_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, sparc64_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + sparc64_pseudo_register_write); /* Register numbers of various important registers. */ set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM); /* %pc */ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 9e7bfde193fc..6e426c457894 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -3176,7 +3176,8 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Pseudo-Register read/write. */ set_gdbarch_pseudo_register_read (gdbarch, xtensa_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, xtensa_pseudo_register_write); + set_gdbarch_deprecated_pseudo_register_write (gdbarch, + xtensa_pseudo_register_write); /* Set target information. */ set_gdbarch_num_regs (gdbarch, tdep->num_regs);