aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog46
-rw-r--r--gdb/alpha-nat.c3
-rw-r--r--gdb/alpha-tdep.c3
-rw-r--r--gdb/arch-utils.c4
-rw-r--r--gdb/arm-tdep.c7
-rw-r--r--gdb/dwarf2-frame.c3
-rw-r--r--gdb/dwarf2loc.c3
-rw-r--r--gdb/findvar.c8
-rw-r--r--gdb/gdbarch.c6
-rw-r--r--gdb/gdbarch.h6
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/hppa-hpux-nat.c12
-rw-r--r--gdb/hppa-linux-nat.c6
-rw-r--r--gdb/i386-linux-nat.c6
-rw-r--r--gdb/i386gnu-nat.c8
-rw-r--r--gdb/ia64-linux-nat.c6
-rw-r--r--gdb/inf-ptrace.c6
-rw-r--r--gdb/infcmd.c8
-rw-r--r--gdb/m68klinux-nat.c6
-rw-r--r--gdb/mi/mi-main.c66
-rw-r--r--gdb/mips-tdep.c40
-rw-r--r--gdb/mn10300-tdep.c2
-rw-r--r--gdb/mt-tdep.c21
-rw-r--r--gdb/ppc-linux-nat.c4
-rw-r--r--gdb/printcmd.c14
-rw-r--r--gdb/regcache.c2
-rw-r--r--gdb/reggroups.c4
-rw-r--r--gdb/remote-sim.c2
-rw-r--r--gdb/remote.c3
-rw-r--r--gdb/rs6000-tdep.c4
-rw-r--r--gdb/sh-tdep.c4
-rw-r--r--gdb/sh64-tdep.c21
-rw-r--r--gdb/stack.c7
-rw-r--r--gdb/target.c6
-rw-r--r--gdb/tracepoint.c15
35 files changed, 231 insertions, 133 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b7bdc7b..c320780 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,49 @@
+2007-06-09 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (REGISTER_NAME): Replace by gdbarch_register_name.
+ * tracepoint.c (scope_info): Likewise.
+ * target.c (debug_print_register): Likewise.
+ * stack.c (frame_info): Likewise.
+ * sh-tdep.c (sh_register_reggroup_p): Likewise.
+ * sh64-tdep.c (sh64_do_fp_register, sh64_do_register)
+ (sh64_media_print_registers_info)
+ (sh64_compact_print_registers_info): Likewise.
+ * rs6000-tdep.c (rs6000_register_reggroup_p): Likewise.
+ * remote-sim.c (gdbsim_fetch_register): Likewise.
+ * remote.c (packet_reg): Likewise (comment).
+ * reggroups.c (default_register_reggroup_p): Likewise.
+ * regcache.c (regcache_dump): Likewise.
+ * printcmd.c (address_info): Likewise.
+ * ppc-linux-nat.c (fetch_register, store_register): Likewise.
+ * mt-dep.c (mt_registers_info): Likewise.
+ * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Likewise (comment).
+ * mips-tdep.c (mips_register_reggroup_p, mips_read_fp_register_single)
+ (mips_read_fp_register_double, mips_print_fp_register)
+ (mips_print_register, print_gp_register_row, mips_print_registers_info)
+ (mips_register_sim_regno): Likewise.
+ * m68klinux-nat.c (regmap, fetch_register, store_register): Likewise.
+ * inf-ptrace.c (inf_ptrace_fetch_register)
+ (inf_ptrace_store_register): Likewise.
+ * infcmd.c (default_print_registers_info): Likewise.
+ * ia64-linux-nat.c (ia64_linux_fetch_register)
+ (ia64_linux_store_register): Likewise.
+ * i386-linux-nat.c (fetch_register, store_register): Likewise.
+ * i386gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Likewise.
+ * hppa-linux-nat.c (fetch_register, store_register): Likewise.
+ * hppa-hpux-nat.c (hppa_hpux_fetch_register)
+ (hppa_hpux_store_register): Likewise.
+ * findvar.c (locate_var_value): Likewise.
+ * dwarf2loc.c (locexpr_describe_location): Likewise.
+ * dwarf2-frame.c (execute_cfa_program): Likewise.
+ * arm-tdep.c (arm_push_dummy_call): Likewise.
+ * arch-utils.c (legacy_register_sim_regno): Likewise.
+ * alpha-tdep.c (alpha_register_reggroup_p): Likewise.
+ * alpha-nat.c (fetch_osf_core_registers): Likewise.
+ * mi/mi-main.c (mi_cmd_data_list_register_names)
+ (mi_cmd_data_list_changed_registers, mi_cmd_data_list_register_values)
+ (mi_cmd_data_write_register_values): Likewise.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
2007-06-07 Daniel Jacobowitz <dan@codesourcery.com>
* target-memory.c (blocks_to_erase): Correct off-by-one error.
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index d90f967..f3196dc 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -113,7 +113,8 @@ fetch_osf_core_registers (struct regcache *regcache,
}
if (bad_reg >= 0)
{
- error (_("Register %s not found in core file."), REGISTER_NAME (bad_reg));
+ error (_("Register %s not found in core file."),
+ gdbarch_register_name (current_gdbarch, bad_reg));
}
}
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 00eaeb9..551be67 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -116,7 +116,8 @@ alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
{
/* Filter out any registers eliminated, but whose regnum is
reserved for backward compatibility, e.g. the vfp. */
- if (REGISTER_NAME (regnum) == NULL || *REGISTER_NAME (regnum) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *gdbarch_register_name (current_gdbarch, regnum) == '\0')
return 0;
if (group == all_reggroup)
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 3a02350..f0bc5bb 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -88,8 +88,8 @@ legacy_register_sim_regno (int regnum)
suspected that some GDB/SIM combinations may rely on this
behavour. The default should be one2one_register_sim_regno
(below). */
- if (REGISTER_NAME (regnum) != NULL
- && REGISTER_NAME (regnum)[0] != '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) != NULL
+ && gdbarch_register_name (current_gdbarch, regnum)[0] != '\0')
return regnum;
else
return LEGACY_SIM_REGNO_IGNORE;
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 5712418..7205471 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1211,7 +1211,8 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "struct return in %s = 0x%s\n",
- REGISTER_NAME (argreg), paddr (struct_addr));
+ gdbarch_register_name (current_gdbarch, argreg),
+ paddr (struct_addr));
regcache_cooked_write_unsigned (regcache, argreg, struct_addr);
argreg++;
}
@@ -1289,7 +1290,9 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
CORE_ADDR regval = extract_unsigned_integer (val, partial_len);
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n",
- argnum, REGISTER_NAME (argreg),
+ argnum,
+ gdbarch_register_name
+ (current_gdbarch, argreg),
phex (regval, DEPRECATED_REGISTER_SIZE));
regcache_cooked_write_unsigned (regcache, argreg, regval);
argreg++;
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 116da31..1bee52f 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -339,7 +339,8 @@ execute_cfa_program (gdb_byte *insn_ptr, gdb_byte *insn_end,
complaint (&symfile_complaints, _("\
incomplete CFI data; DW_CFA_restore unspecified\n\
register %s (#%d) at 0x%s"),
- REGISTER_NAME(DWARF2_REG_TO_REGNUM(reg)),
+ gdbarch_register_name
+ (current_gdbarch, DWARF2_REG_TO_REGNUM(reg)),
DWARF2_REG_TO_REGNUM(reg), paddr (fs->pc));
}
else
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 1e6ff67..d79c1f5 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -452,7 +452,8 @@ locexpr_describe_location (struct symbol *symbol, struct ui_file *stream)
{
int regno = DWARF2_REG_TO_REGNUM (dlbaton->data[0] - DW_OP_reg0);
fprintf_filtered (stream,
- "a variable in register %s", REGISTER_NAME (regno));
+ "a variable in register %s",
+ gdbarch_register_name (current_gdbarch, regno));
return 1;
}
diff --git a/gdb/findvar.c b/gdb/findvar.c
index e3f9fd5..971bb44 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -708,12 +708,14 @@ locate_var_value (struct symbol *var, struct frame_info *frame)
switch (VALUE_LVAL (lazy_value))
{
case lval_register:
- gdb_assert (REGISTER_NAME (VALUE_REGNUM (lazy_value)) != NULL
- && *REGISTER_NAME (VALUE_REGNUM (lazy_value)) != '\0');
+ gdb_assert (gdbarch_register_name
+ (current_gdbarch, VALUE_REGNUM (lazy_value)) != NULL
+ && *gdbarch_register_name
+ (current_gdbarch, VALUE_REGNUM (lazy_value)) != '\0');
error (_("Address requested for identifier "
"\"%s\" which is in register $%s"),
SYMBOL_PRINT_NAME (var),
- REGISTER_NAME (VALUE_REGNUM (lazy_value)));
+ gdbarch_register_name (current_gdbarch, VALUE_REGNUM (lazy_value)));
break;
default:
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 6efc143..b9a049d 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -1198,12 +1198,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"gdbarch_dump: read_pc = <0x%lx>\n",
(long) current_gdbarch->read_pc);
-#ifdef REGISTER_NAME
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "REGISTER_NAME(regnr)",
- XSTRING (REGISTER_NAME (regnr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: register_name = <0x%lx>\n",
(long) current_gdbarch->register_name);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index c3233fb..4d60ade 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -409,12 +409,6 @@ extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_d
typedef const char * (gdbarch_register_name_ftype) (int regnr);
extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
-#if !defined (GDB_TM_FILE) && defined (REGISTER_NAME)
-#error "Non multi-arch definition of REGISTER_NAME"
-#endif
-#if !defined (REGISTER_NAME)
-#define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
-#endif
/* Return the type of a register specified by the architecture. Only
the register cache should call this function directly; others should
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index fc3ae43..a811f7b 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -454,7 +454,7 @@ f:=:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr::no_op_reg_to_regnum::0
# Convert from an sdb register number to an internal gdb register number.
f:=:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr::no_op_reg_to_regnum::0
f:=:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr::no_op_reg_to_regnum::0
-f:=:const char *:register_name:int regnr:regnr
+f::const char *:register_name:int regnr:regnr
# Return the type of a register specified by the architecture. Only
# the register cache should call this function directly; others should
diff --git a/gdb/hppa-hpux-nat.c b/gdb/hppa-hpux-nat.c
index 325bbc0..70924f0 100644
--- a/gdb/hppa-hpux-nat.c
+++ b/gdb/hppa-hpux-nat.c
@@ -110,7 +110,8 @@ hppa_hpux_fetch_register (struct regcache *regcache, int regnum)
if (ttrace (TT_LWP_RUREGS, pid, lwp, addr, size, (uintptr_t)buf) == -1)
error (_("Couldn't read register %s (#%d): %s"),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
}
#else
{
@@ -123,7 +124,8 @@ hppa_hpux_fetch_register (struct regcache *regcache, int regnum)
buf[i] = ptrace (PT_RUREGS, pid, (PTRACE_TYPE_ARG3) addr, 0, 0);
if (errno != 0)
error (_("Couldn't read register %s (#%d): %s"),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
addr += sizeof (PTRACE_TYPE_RET);
}
@@ -187,7 +189,8 @@ hppa_hpux_store_register (struct regcache *regcache, int regnum)
if (ttrace (TT_LWP_WUREGS, pid, lwp, addr, size, (uintptr_t)buf) == -1)
error (_("Couldn't write register %s (#%d): %s"),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
}
#else
{
@@ -200,7 +203,8 @@ hppa_hpux_store_register (struct regcache *regcache, int regnum)
ptrace (PT_WUREGS, pid, (PTRACE_TYPE_ARG3) addr, buf[i], 0);
if (errno != 0)
error (_("Couldn't write register %s (#%d): %s"),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
addr += sizeof (PTRACE_TYPE_RET);
}
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
index c4319a0..6897e9f 100644
--- a/gdb/hppa-linux-nat.c
+++ b/gdb/hppa-linux-nat.c
@@ -235,7 +235,8 @@ fetch_register (struct regcache *regcache, int regno)
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0);
if (errno != 0)
- error (_("Couldn't read register %s (#%d): %s."), REGISTER_NAME (regno),
+ error (_("Couldn't read register %s (#%d): %s."),
+ gdbarch_register_name (current_gdbarch, regno),
regno, safe_strerror (errno));
regcache_raw_supply (regcache, regno, &val);
@@ -261,7 +262,8 @@ store_register (const struct regcache *regcache, int regno)
regcache_raw_collect (regcache, regno, &val);
ptrace (PTRACE_POKEUSER, tid, hppa_linux_register_addr (regno, 0), val);
if (errno != 0)
- error (_("Couldn't write register %s (#%d): %s."), REGISTER_NAME (regno),
+ error (_("Couldn't write register %s (#%d): %s."),
+ gdbarch_register_name (current_gdbarch, regno),
regno, safe_strerror (errno));
}
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index ceb8084..1541cfc 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -162,7 +162,8 @@ fetch_register (struct regcache *regcache, int regno)
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid, 4 * regmap[regno], 0);
if (errno != 0)
- error (_("Couldn't read register %s (#%d): %s."), REGISTER_NAME (regno),
+ error (_("Couldn't read register %s (#%d): %s."),
+ gdbarch_register_name (current_gdbarch, regno),
regno, safe_strerror (errno));
regcache_raw_supply (regcache, regno, &val);
@@ -189,7 +190,8 @@ store_register (const struct regcache *regcache, int regno)
regcache_raw_collect (regcache, regno, &val);
ptrace (PTRACE_POKEUSER, tid, 4 * regmap[regno], val);
if (errno != 0)
- error (_("Couldn't write register %s (#%d): %s."), REGISTER_NAME (regno),
+ error (_("Couldn't write register %s (#%d): %s."),
+ gdbarch_register_name (current_gdbarch, regno),
regno, safe_strerror (errno));
}
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 3547cd5..e15d305 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -150,7 +150,8 @@ gnu_fetch_registers (struct regcache *regcache, int regno)
}
else
{
- proc_debug (thread, "fetching register %s", REGISTER_NAME (regno));
+ proc_debug (thread, "fetching register %s",
+ gdbarch_register_name (current_gdbarch, regno));
regcache_raw_supply (regcache, regno,
REG_ADDR (state, regno));
@@ -248,7 +249,7 @@ gnu_store_registers (struct regcache *regcache, int regno)
/* Register CHECK_REGNO has changed! Ack! */
{
warning (_("Register %s changed after the thread was aborted"),
- REGISTER_NAME (check_regno));
+ gdbarch_register_name (current_gdbarch, check_regno));
if (regno >= 0 && regno != check_regno)
/* Update GDB's copy of the register. */
regcache_raw_supply (regcache, check_regno,
@@ -270,7 +271,8 @@ gnu_store_registers (struct regcache *regcache, int regno)
}
else
{
- proc_debug (thread, "storing register %s", REGISTER_NAME (regno));
+ proc_debug (thread, "storing register %s",
+ gdbarch_register_name (current_gdbarch, regno));
gdb_assert (regcache_valid_p (regcache, regno));
regcache_raw_collect (regcache, regno, REG_ADDR (state, regno));
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 418b171..d50fc29 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -704,7 +704,8 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
buf[i] = ptrace (PT_READ_U, pid, (PTRACE_TYPE_ARG3)addr, 0);
if (errno != 0)
error (_("Couldn't read register %s (#%d): %s."),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
addr += sizeof (PTRACE_TYPE_RET);
}
@@ -758,7 +759,8 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum)
ptrace (PT_WRITE_U, pid, (PTRACE_TYPE_ARG3)addr, buf[i]);
if (errno != 0)
error (_("Couldn't write register %s (#%d): %s."),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
addr += sizeof (PTRACE_TYPE_RET);
}
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 9b485f0..c018ab4 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -650,7 +650,8 @@ inf_ptrace_fetch_register (struct regcache *regcache, int regnum)
buf[i] = ptrace (PT_READ_U, pid, (PTRACE_TYPE_ARG3)(uintptr_t)addr, 0);
if (errno != 0)
error (_("Couldn't read register %s (#%d): %s."),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
addr += sizeof (PTRACE_TYPE_RET);
}
@@ -704,7 +705,8 @@ inf_ptrace_store_register (const struct regcache *regcache, int regnum)
ptrace (PT_WRITE_U, pid, (PTRACE_TYPE_ARG3)(uintptr_t)addr, buf[i]);
if (errno != 0)
error (_("Couldn't write register %s (#%d): %s."),
- REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+ gdbarch_register_name (current_gdbarch, regnum),
+ regnum, safe_strerror (errno));
addr += sizeof (PTRACE_TYPE_RET);
}
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 4464577..59602e0 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1628,11 +1628,13 @@ default_print_registers_info (struct gdbarch *gdbarch,
/* If the register name is empty, it is undefined for this
processor, so don't display anything. */
- if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
+ if (gdbarch_register_name (current_gdbarch, i) == NULL
+ || *(gdbarch_register_name (current_gdbarch, i)) == '\0')
continue;
- fputs_filtered (REGISTER_NAME (i), file);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
+ fputs_filtered (gdbarch_register_name (current_gdbarch, i), file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, i)), file);
/* Get the data in raw format. */
if (! frame_register_read (frame, i, buffer))
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 6844f51..9d68cf8 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -55,7 +55,7 @@
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
-/* This table must line up with REGISTER_NAME in "m68k-tdep.c". */
+/* This table must line up with gdbarch_register_name in "m68k-tdep.c". */
static const int regmap[] =
{
PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7,
@@ -146,7 +146,7 @@ fetch_register (struct regcache *regcache, int regno)
if (errno != 0)
{
sprintf (mess, "reading register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (mess);
}
}
@@ -209,7 +209,7 @@ store_register (const struct regcache *regcache, int regno)
if (errno != 0)
{
sprintf (mess, "writing register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (mess);
}
}
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index ad7aae0..1193b0c 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -286,10 +286,10 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc)
struct cleanup *cleanup;
/* Note that the test for a valid register must include checking the
- REGISTER_NAME because gdbarch_num_regs may be allocated for the union of
- the register sets within a family of related processors. In this
- case, some entries of REGISTER_NAME will change depending upon
- the particular processor being debugged. */
+ gdbarch_register_name because gdbarch_num_regs may be allocated for
+ the union of the register sets within a family of related processors.
+ In this case, some entries of gdbarch_register_name will change depending
+ upon the particular processor being debugged. */
numregs = gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch);
@@ -302,11 +302,13 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc)
regnum < numregs;
regnum++)
{
- if (REGISTER_NAME (regnum) == NULL
- || *(REGISTER_NAME (regnum)) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
ui_out_field_string (uiout, NULL, "");
else
- ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum));
+ ui_out_field_string (uiout, NULL,
+ gdbarch_register_name
+ (current_gdbarch, regnum));
}
}
@@ -320,11 +322,12 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc)
mi_error_message = xstrprintf ("bad register number");
return MI_CMD_ERROR;
}
- if (REGISTER_NAME (regnum) == NULL
- || *(REGISTER_NAME (regnum)) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
ui_out_field_string (uiout, NULL, "");
else
- ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum));
+ ui_out_field_string (uiout, NULL,
+ gdbarch_register_name (current_gdbarch, regnum));
}
do_cleanups (cleanup);
return MI_CMD_DONE;
@@ -348,10 +351,10 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
cleanup = make_cleanup_regcache_xfree (prev_regs);
/* Note that the test for a valid register must include checking the
- REGISTER_NAME because gdbarch_num_regs may be allocated for the union of
- the register sets within a family of related processors. In this
- case, some entries of REGISTER_NAME will change depending upon
- the particular processor being debugged. */
+ gdbarch_register_name because gdbarch_num_regs may be allocated for
+ the union of the register sets within a family of related processors.
+ In this case, some entries of gdbarch_register_name will change depending
+ upon the particular processor being debugged. */
numregs = gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch);
@@ -364,8 +367,8 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
regnum < numregs;
regnum++)
{
- if (REGISTER_NAME (regnum) == NULL
- || *(REGISTER_NAME (regnum)) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
continue;
changed = register_changed_p (regnum, prev_regs, this_regs);
if (changed < 0)
@@ -386,8 +389,8 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
if (regnum >= 0
&& regnum < numregs
- && REGISTER_NAME (regnum) != NULL
- && *REGISTER_NAME (regnum) != '\000')
+ && gdbarch_register_name (current_gdbarch, regnum) != NULL
+ && *gdbarch_register_name (current_gdbarch, regnum) != '\000')
{
changed = register_changed_p (regnum, prev_regs, this_regs);
if (changed < 0)
@@ -451,10 +454,10 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc)
struct cleanup *list_cleanup, *tuple_cleanup;
/* Note that the test for a valid register must include checking the
- REGISTER_NAME because gdbarch_num_regs may be allocated for the union of
- the register sets within a family of related processors. In this
- case, some entries of REGISTER_NAME will change depending upon
- the particular processor being debugged. */
+ gdbarch_register_name because gdbarch_num_regs may be allocated for
+ the union of the register sets within a family of related processors.
+ In this case, some entries of gdbarch_register_name will change depending
+ upon the particular processor being debugged. */
numregs = gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch);
@@ -475,8 +478,8 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc)
regnum < numregs;
regnum++)
{
- if (REGISTER_NAME (regnum) == NULL
- || *(REGISTER_NAME (regnum)) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
continue;
tuple_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_int (uiout, "number", regnum);
@@ -497,8 +500,8 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc)
if (regnum >= 0
&& regnum < numregs
- && REGISTER_NAME (regnum) != NULL
- && *REGISTER_NAME (regnum) != '\000')
+ && gdbarch_register_name (current_gdbarch, regnum) != NULL
+ && *gdbarch_register_name (current_gdbarch, regnum) != '\000')
{
tuple_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_int (uiout, "number", regnum);
@@ -583,10 +586,10 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
char format;
/* Note that the test for a valid register must include checking the
- REGISTER_NAME because gdbarch_num_regs may be allocated for the union of
- the register sets within a family of related processors. In this
- case, some entries of REGISTER_NAME will change depending upon
- the particular processor being debugged. */
+ gdbarch_register_name because gdbarch_num_regs may be allocated for
+ the union of the register sets within a family of related processors.
+ In this case, some entries of gdbarch_register_name will change depending
+ upon the particular processor being debugged. */
numregs = gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch);
@@ -622,7 +625,8 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
int regnum = atoi (argv[i]);
if (regnum >= 0 && regnum < numregs
- && REGISTER_NAME (regnum) && *REGISTER_NAME (regnum))
+ && gdbarch_register_name (current_gdbarch, regnum)
+ && *gdbarch_register_name (current_gdbarch, regnum))
{
LONGEST value;
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 41ffb95..f0ef475 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -537,7 +537,8 @@ mips_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
/* FIXME: cagney/2003-04-13: Can't yet use gdbarch_num_regs
(gdbarch), as not all architectures are multi-arch. */
raw_p = rawnum < gdbarch_num_regs (current_gdbarch);
- if (REGISTER_NAME (regnum) == NULL || REGISTER_NAME (regnum)[0] == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || gdbarch_register_name (current_gdbarch, regnum)[0] == '\0')
return 0;
if (reggroup == float_reggroup)
return float_p && pseudo;
@@ -3818,7 +3819,8 @@ mips_read_fp_register_single (struct frame_info *frame, int regno,
gdb_byte *raw_buffer = alloca (raw_size);
if (!frame_register_read (frame, regno, raw_buffer))
- error (_("can't read register %d (%s)"), regno, REGISTER_NAME (regno));
+ error (_("can't read register %d (%s)"),
+ regno, gdbarch_register_name (current_gdbarch, regno));
if (raw_size == 8)
{
/* We have a 64-bit value for this register. Find the low-order
@@ -3853,7 +3855,8 @@ mips_read_fp_register_double (struct frame_info *frame, int regno,
/* We have a 64-bit value for this register, and we should use
all 64 bits. */
if (!frame_register_read (frame, regno, rare_buffer))
- error (_("can't read register %d (%s)"), regno, REGISTER_NAME (regno));
+ error (_("can't read register %d (%s)"),
+ regno, gdbarch_register_name (current_gdbarch, regno));
}
else
{
@@ -3888,8 +3891,11 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
raw_buffer = alloca (2 * register_size (current_gdbarch,
mips_regnum (current_gdbarch)->fp0));
- fprintf_filtered (file, "%s:", REGISTER_NAME (regnum));
- fprintf_filtered (file, "%*s", 4 - (int) strlen (REGISTER_NAME (regnum)),
+ fprintf_filtered (file, "%s:",
+ gdbarch_register_name (current_gdbarch, regnum));
+ fprintf_filtered (file, "%*s",
+ 4 - (int) strlen (gdbarch_register_name
+ (current_gdbarch, regnum)),
"");
if (register_size (current_gdbarch, regnum) == 4 || mips2_fp_compat ())
@@ -3965,11 +3971,12 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
/* Get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
{
- fprintf_filtered (file, "%s: [Invalid]", REGISTER_NAME (regnum));
+ fprintf_filtered (file, "%s: [Invalid]",
+ gdbarch_register_name (current_gdbarch, regnum));
return;
}
- fputs_filtered (REGISTER_NAME (regnum), file);
+ fputs_filtered (gdbarch_register_name (current_gdbarch, regnum), file);
/* The problem with printing numeric register names (r26, etc.) is that
the user can't use them on input. Probably the best solution is to
@@ -4025,7 +4032,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
+ gdbarch_num_pseudo_regs (current_gdbarch);
regnum++)
{
- if (*REGISTER_NAME (regnum) == '\0')
+ if (*gdbarch_register_name (current_gdbarch, regnum) == '\0')
continue; /* unused register */
if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
@@ -4034,7 +4041,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
fprintf_filtered (file, " ");
fprintf_filtered (file,
mips_abi_regsize (current_gdbarch) == 8 ? "%17s" : "%9s",
- REGISTER_NAME (regnum));
+ gdbarch_register_name (current_gdbarch, regnum));
col++;
}
@@ -4054,14 +4061,15 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
+ gdbarch_num_pseudo_regs (current_gdbarch);
regnum++)
{
- if (*REGISTER_NAME (regnum) == '\0')
+ if (*gdbarch_register_name (current_gdbarch, regnum) == '\0')
continue; /* unused register */
if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
break; /* end row: reached FP register */
/* OK: get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
- error (_("can't read register %d (%s)"), regnum, REGISTER_NAME (regnum));
+ error (_("can't read register %d (%s)"),
+ regnum, gdbarch_register_name (current_gdbarch, regnum));
/* pad small registers */
for (byte = 0;
byte < (mips_abi_regsize (current_gdbarch)
@@ -4096,7 +4104,7 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
if (regnum != -1) /* do one specified register */
{
gdb_assert (regnum >= gdbarch_num_regs (current_gdbarch));
- if (*(REGISTER_NAME (regnum)) == '\0')
+ if (*(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
error (_("Not a valid register for the current processor type"));
mips_print_register (file, frame, regnum, 0);
@@ -4593,8 +4601,12 @@ mips_register_sim_regno (int regnum)
/* FIXME: cagney/2002-05-13: Need to look at the pseudo register to
decide if it is valid. Should instead define a standard sim/gdb
register numbering scheme. */
- if (REGISTER_NAME (gdbarch_num_regs (current_gdbarch) + regnum) != NULL
- && REGISTER_NAME (gdbarch_num_regs (current_gdbarch) + regnum)[0] != '\0')
+ if (gdbarch_register_name (current_gdbarch,
+ gdbarch_num_regs
+ (current_gdbarch) + regnum) != NULL
+ && gdbarch_register_name (current_gdbarch,
+ gdbarch_num_regs
+ (current_gdbarch) + regnum)[0] != '\0')
return regnum;
else
return LEGACY_SIM_REGNO_IGNORE;
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index d4edd28..d5f5e47 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1078,7 +1078,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
static int
mn10300_dwarf2_reg_to_regnum (int dwarf2)
{
- /* This table is supposed to be shaped like the REGISTER_NAMES
+ /* This table is supposed to be shaped like the gdbarch_register_name
initializer in gcc/config/mn10300/mn10300.h. Registers which
appear in GCC's numbering, but have no counterpart in GDB's
world, are marked with a -1. */
diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c
index 3bf0a55..537a05b 100644
--- a/gdb/mt-tdep.c
+++ b/gdb/mt-tdep.c
@@ -661,8 +661,11 @@ mt_registers_info (struct gdbarch *gdbarch,
frame_register_read (frame, regnum, buff);
- fputs_filtered (REGISTER_NAME (regnum), file);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), file);
+ fputs_filtered (gdbarch_register_name
+ (current_gdbarch, regnum), file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, regnum)),
+ file);
fputs_filtered ("0x", file);
for (i = 0; i < regsize; i++)
@@ -683,8 +686,11 @@ mt_registers_info (struct gdbarch *gdbarch,
frame_register_read (frame, MT_COPRO_REGNUM, buf);
/* And print. */
regnum = MT_COPRO_PSEUDOREG_REGNUM;
- fputs_filtered (REGISTER_NAME (regnum), file);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), file);
+ fputs_filtered (gdbarch_register_name (current_gdbarch, regnum),
+ file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, regnum)),
+ file);
val_print (register_type (gdbarch, regnum), buf,
0, 0, file, 0, 1, 0, Val_no_prettyprint);
fputs_filtered ("\n", file);
@@ -713,8 +719,11 @@ mt_registers_info (struct gdbarch *gdbarch,
/* And print. */
regnum = MT_MAC_PSEUDOREG_REGNUM;
- fputs_filtered (REGISTER_NAME (regnum), file);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), file);
+ fputs_filtered (gdbarch_register_name (current_gdbarch, regnum),
+ file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, regnum)),
+ file);
fputs_filtered ("0x", file);
print_longest (file, 'x', 0, newmac);
fputs_filtered ("\t", file);
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 5f30613..c6d2fe6 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -381,7 +381,7 @@ fetch_register (struct regcache *regcache, int tid, int regno)
{
char message[128];
sprintf (message, "reading register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (message);
}
}
@@ -685,7 +685,7 @@ store_register (const struct regcache *regcache, int tid, int regno)
{
char message[128];
sprintf (message, "writing register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (message);
}
}
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 8843010..94d31e4 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1113,7 +1113,8 @@ address_info (char *exp, int from_tty)
break;
case LOC_REGISTER:
- printf_filtered (_("a variable in register %s"), REGISTER_NAME (val));
+ printf_filtered (_("a variable in register %s"),
+ gdbarch_register_name (current_gdbarch, val));
break;
case LOC_STATIC:
@@ -1144,12 +1145,13 @@ address_info (char *exp, int from_tty)
break;
case LOC_REGPARM:
- printf_filtered (_("an argument in register %s"), REGISTER_NAME (val));
+ printf_filtered (_("an argument in register %s"),
+ gdbarch_register_name (current_gdbarch, val));
break;
case LOC_REGPARM_ADDR:
printf_filtered (_("address of an argument in register %s"),
- REGISTER_NAME (val));
+ gdbarch_register_name (current_gdbarch, val));
break;
case LOC_ARG:
@@ -1170,12 +1172,12 @@ address_info (char *exp, int from_tty)
case LOC_BASEREG:
printf_filtered (_("a variable at offset %ld from register %s"),
- val, REGISTER_NAME (basereg));
+ val, gdbarch_register_name (current_gdbarch, basereg));
break;
case LOC_BASEREG_ARG:
printf_filtered (_("an argument at offset %ld from register %s"),
- val, REGISTER_NAME (basereg));
+ val, gdbarch_register_name (current_gdbarch, basereg));
break;
case LOC_TYPEDEF:
@@ -1222,7 +1224,7 @@ address_info (char *exp, int from_tty)
case LOC_HP_THREAD_LOCAL_STATIC:
printf_filtered (_("\
a thread-local variable at offset %ld from the thread base register %s"),
- val, REGISTER_NAME (basereg));
+ val, gdbarch_register_name (current_gdbarch, basereg));
break;
case LOC_OPTIMIZED_OUT:
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 9899f60..e545dfa 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1027,7 +1027,7 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
fprintf_unfiltered (file, " %-10s", "Name");
else
{
- const char *p = REGISTER_NAME (regnum);
+ const char *p = gdbarch_register_name (current_gdbarch, regnum);
if (p == NULL)
p = "";
else if (p[0] == '\0')
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index 90bcb8e..5727921 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -159,8 +159,8 @@ default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
int float_p;
int raw_p;
- if (REGISTER_NAME (regnum) == NULL
- || *REGISTER_NAME (regnum) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *gdbarch_register_name (current_gdbarch, regnum) == '\0')
return 0;
if (group == all_reggroup)
return 1;
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index f2b7c6c..8c13888 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -317,7 +317,7 @@ gdbsim_fetch_register (struct regcache *regcache, int regno)
{
fprintf_unfiltered (gdb_stderr,
"Size of register %s (%d/%d) incorrect (%d instead of %d))",
- REGISTER_NAME (regno),
+ gdbarch_register_name (current_gdbarch, regno),
regno, REGISTER_SIM_REGNO (regno),
nr_bytes, register_size (current_gdbarch, regno));
warn_user = 0;
diff --git a/gdb/remote.c b/gdb/remote.c
index acb30ab..4662437 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -260,7 +260,8 @@ struct packet_reg
int in_g_packet; /* Always part of G packet. */
/* long size in bytes; == register_size (current_gdbarch, regnum);
at present. */
- /* char *name; == REGISTER_NAME (regnum); at present. */
+ /* char *name; == gdbarch_register_name (current_gdbarch, regnum);
+ at present. */
};
struct remote_arch_state
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 89f9276..50557c0 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2092,8 +2092,8 @@ rs6000_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
int vector_p;
int general_p;
- if (REGISTER_NAME (regnum) == NULL
- || *REGISTER_NAME (regnum) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *gdbarch_register_name (current_gdbarch, regnum) == '\0')
return 0;
if (group == all_reggroup)
return 1;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 2fd3165..0d2b5ea 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1890,8 +1890,8 @@ int
sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *reggroup)
{
- if (REGISTER_NAME (regnum) == NULL
- || *REGISTER_NAME (regnum) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *gdbarch_register_name (current_gdbarch, regnum) == '\0')
return 0;
if (reggroup == float_reggroup
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 88e1371..7061f32 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -1968,14 +1968,16 @@ sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
/* Get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
- error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
+ error ("can't read register %d (%s)",
+ regnum, gdbarch_register_name (current_gdbarch, regnum));
/* Get the register as a number */
flt = unpack_double (builtin_type_float, raw_buffer, &inv);
/* Print the name and some spaces. */
- fputs_filtered (REGISTER_NAME (regnum), file);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), file);
+ fputs_filtered (gdbarch_register_name (current_gdbarch, regnum), file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, regnum)), file);
/* Print the value. */
if (inv)
@@ -2074,8 +2076,9 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
{
unsigned char raw_buffer[MAX_REGISTER_SIZE];
- fputs_filtered (REGISTER_NAME (regnum), file);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), file);
+ fputs_filtered (gdbarch_register_name (current_gdbarch, regnum), file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, regnum)), file);
/* Get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
@@ -2118,7 +2121,7 @@ sh64_media_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
{
if (regnum != -1) /* do one specified register */
{
- if (*(REGISTER_NAME (regnum)) == '\0')
+ if (*(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
error ("Not a valid register for the current processor type");
sh64_print_register (gdbarch, file, frame, regnum);
@@ -2131,8 +2134,8 @@ sh64_media_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
{
/* If the register name is empty, it is undefined for this
processor, so don't display anything. */
- if (REGISTER_NAME (regnum) == NULL
- || *(REGISTER_NAME (regnum)) == '\0')
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
{
regnum++;
continue;
@@ -2175,7 +2178,7 @@ sh64_compact_print_registers_info (struct gdbarch *gdbarch,
{
if (regnum != -1) /* do one specified register */
{
- if (*(REGISTER_NAME (regnum)) == '\0')
+ if (*(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
error ("Not a valid register for the current processor type");
if (regnum >= 0 && regnum < R0_C_REGNUM)
diff --git a/gdb/stack.c b/gdb/stack.c
index dcc475c..2bc5036 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -844,7 +844,7 @@ frame_info (char *addr_exp, int from_tty)
/* OK, this is weird. The PC_REGNUM hardware register's value can
easily not match that of the internal value returned by
get_frame_pc(). */
- pc_regname = REGISTER_NAME (PC_REGNUM);
+ pc_regname = gdbarch_register_name (current_gdbarch, PC_REGNUM);
else
/* But then, this is weird to. Even without PC_REGNUM, an
architectures will often have a hardware register called "pc",
@@ -1052,7 +1052,7 @@ frame_info (char *addr_exp, int from_tty)
else if (!optimized && lval == lval_register)
{
printf_filtered (" Previous frame's sp in %s\n",
- REGISTER_NAME (realnum));
+ gdbarch_register_name (current_gdbarch, realnum));
need_nl = 0;
}
/* else keep quiet. */
@@ -1078,7 +1078,8 @@ frame_info (char *addr_exp, int from_tty)
else
puts_filtered (",");
wrap_here (" ");
- printf_filtered (" %s at ", REGISTER_NAME (i));
+ printf_filtered (" %s at ",
+ gdbarch_register_name (current_gdbarch, i));
deprecated_print_address_numeric (addr, 1, gdb_stdout);
count++;
}
diff --git a/gdb/target.c b/gdb/target.c
index 3331d8b..496cd92 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2156,8 +2156,10 @@ debug_print_register (const char * func,
fprintf_unfiltered (gdb_stdlog, "%s ", func);
if (regno >= 0 && regno < gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch)
- && REGISTER_NAME (regno) != NULL && REGISTER_NAME (regno)[0] != '\0')
- fprintf_unfiltered (gdb_stdlog, "(%s)", REGISTER_NAME (regno));
+ && gdbarch_register_name (current_gdbarch, regno) != NULL
+ && gdbarch_register_name (current_gdbarch, regno)[0] != '\0')
+ fprintf_unfiltered (gdb_stdlog, "(%s)", gdbarch_register_name
+ (current_gdbarch, regno));
else
fprintf_unfiltered (gdb_stdlog, "(%d)", regno);
if (regno >= 0)
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 8a33bb9..41d4543 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2443,7 +2443,8 @@ scope_info (char *args, int from_tty)
break;
case LOC_REGISTER:
printf_filtered ("a local variable in register $%s",
- REGISTER_NAME (SYMBOL_VALUE (sym)));
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_VALUE (sym)));
break;
case LOC_ARG:
case LOC_LOCAL_ARG:
@@ -2460,11 +2461,13 @@ scope_info (char *args, int from_tty)
break;
case LOC_REGPARM:
printf_filtered ("an argument in register $%s",
- REGISTER_NAME (SYMBOL_VALUE (sym)));
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_VALUE (sym)));
break;
case LOC_REGPARM_ADDR:
printf_filtered ("the address of an argument, in register $%s",
- REGISTER_NAME (SYMBOL_VALUE (sym)));
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_VALUE (sym)));
break;
case LOC_TYPEDEF:
printf_filtered ("a typedef.\n");
@@ -2482,12 +2485,14 @@ scope_info (char *args, int from_tty)
case LOC_BASEREG:
printf_filtered ("a variable at offset %ld from register $%s",
SYMBOL_VALUE (sym),
- REGISTER_NAME (SYMBOL_BASEREG (sym)));
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_BASEREG (sym)));
break;
case LOC_BASEREG_ARG:
printf_filtered ("an argument at offset %ld from register $%s",
SYMBOL_VALUE (sym),
- REGISTER_NAME (SYMBOL_BASEREG (sym)));
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_BASEREG (sym)));
break;
case LOC_UNRESOLVED:
msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym),