[PATCH 16/24] gdb: rename gdbarch_pseudo_register_write to gdbarch_deprecated_pseudo_register_write

Simon Marchi
2023-11-08T05:17:11Z

From: Simon Marchi <simon.marchi@efficios.com>

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
---
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 341a6a19de5f..d1a6d46fb1f2 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 5c8c4cd4e94b..cd4c760c2ff4 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 92aec3b510f5..5690f6f65c74 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 3656f6fcb663..e4c10dfb4347 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 c2de274ed2a9..3160aa8a9613 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 86754af17cc3..1100da160550 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 7f849bac6cd3..5f12f17bc5eb 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -8603,7 +8603,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 d4c1736f0e7f..34b7fa09d5d3 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 e06dbbe12bff..d053135e592d 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 a84df4e1f53c..94d1ddf2a147 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 8e25c45dd297..a4ba68748b9c 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 97d9073efbbe..92404045497c 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 ff5f5b70433e..dadc949434ee 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -930,8 +930,8 @@ regcache::cooked_write (int regnum, gdb::array_view<const gdb_byte> src, float)
if (regnum < num_raw_registers ())
raw_write (regnum, src, 1.0f);
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 48f5a9e35e67..c1b9c8d435e5 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 819f07b47c0a..78016eb8fccd 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -8291,8 +8291,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 54b5c89e5e3c..52faae971ee6 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 c9935d152641..8f313f0feabd 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -3174,7 +3174,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);
--
2.42.1