* 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-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.
}
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));
}
}
{
/* 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)
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;
{
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++;
}
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++;
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
{
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;
}
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:
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);
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
# 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
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
{
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);
}
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
{
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);
}
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);
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));
}
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);
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));
}
\f
}
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));
/* 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,
}
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));
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);
}
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);
}
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);
}
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);
}
/* 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))
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
\f
-/* 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,
if (errno != 0)
{
sprintf (mess, "reading register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (mess);
}
}
if (errno != 0)
{
sprintf (mess, "writing register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (mess);
}
}
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);
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));
}
}
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;
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);
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)
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)
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);
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);
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);
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);
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;
/* 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;
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
/* 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
{
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 ())
/* 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
+ 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)
fprintf_filtered (file, " ");
fprintf_filtered (file,
mips_abi_regsize (current_gdbarch) == 8 ? "%17s" : "%9s",
- REGISTER_NAME (regnum));
+ gdbarch_register_name (current_gdbarch, regnum));
col++;
}
+ 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)
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);
/* 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;
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. */
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++)
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);
/* 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);
{
char message[128];
sprintf (message, "reading register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (message);
}
}
{
char message[128];
sprintf (message, "writing register %s (#%d)",
- REGISTER_NAME (regno), regno);
+ gdbarch_register_name (current_gdbarch, regno), regno);
perror_with_name (message);
}
}
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:
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:
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:
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:
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')
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;
{
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;
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
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;
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
/* 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)
{
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))
{
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);
{
/* 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;
{
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)
/* 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",
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. */
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++;
}
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)
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:
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");
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),