This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] [1/9] Remove macro REGISTER_NAME
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Fri, 08 Jun 2007 08:27:14 +0200
- Subject: Re: [rfc] [1/9] Remove macro REGISTER_NAME
- References: <200706061517.l56FH0IE009064@d12av02.megacenter.de.ibm.com>
Hi Ulrich,
Ulrich Weigand wrote:
Markus Deuling wrote:
this patch removes REGISTER_NAME macro from gdbarch.sh
Look good except for some minor formatting issues:
* sh64-tdep.c (sh64_do_fp_register,sh64_do_register)
Should have space after comma (throughout the ChangeLog).
+ if (gdbarch_register_name (current_gdbarch, regnum) == NULL
+ || *gdbarch_register_name (current_gdbarch, (regnum)) == '\0')
Parentheses around "regnum" are unnecessary.
+ gdbarch_register_name
+ (current_gdbarch, argreg),
I think convention is to indent the argument list by two space
if it starts completely on a new line ...
+ gdbarch_register_name (current_gdbarch,
+ DWARF2_REG_TO_REGNUM(reg)),
Indentation is quite odd here...
+ gdb_assert (gdbarch_register_name (current_gdbarch,
+ VALUE_REGNUM (lazy_value)) != NULL
+ && *gdbarch_register_name
+ (current_gdbarch, VALUE_REGNUM (lazy_value)) != '\0');
And here.
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch,i)), file);
Indentation. Space after comma.
+ ui_out_field_string (uiout, NULL,
+ gdbarch_register_name
+ (current_gdbarch, regnum));
Indentation.
+ fprintf_filtered (file, "%*s", 4 - (int) strlen (gdbarch_register_name
+ (current_gdbarch, regnum)),
Indentation.
+ 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')
Indentation
frame_register_read (frame, regnum, buff);
+ fputs_filtered (gdbarch_register_name (current_gdbarch, regnum), file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, regnum)), file);
Indentation.
+ fputs_filtered (gdbarch_register_name (current_gdbarch, regnum), file);
+ print_spaces_filtered (15 - strlen (gdbarch_register_name
+ (current_gdbarch, regnum)), file);
Again.
+ fprintf_unfiltered (gdb_stdlog, "(%s)", gdbarch_register_name
+ (current_gdbarch, regno));
Again.
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_VALUE (sym)));
Again.
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_VALUE (sym)));
Again.
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_VALUE (sym)));
Again.
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_BASEREG (sym)));
Again.
+ gdbarch_register_name
+ (current_gdbarch, SYMBOL_BASEREG (sym)));
Again.
Bye,
Ulrich
thank you very much for your review. I attached a patch that addresses those points.
Ok to commit?
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
diff -urN src/gdb/alpha-nat.c dev/gdb/alpha-nat.c
--- src/gdb/alpha-nat.c 2007-05-31 19:20:41.000000000 +0200
+++ dev/gdb/alpha-nat.c 2007-06-08 06:04:49.000000000 +0200
@@ -113,7 +113,8 @@
}
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 -urN src/gdb/alpha-tdep.c dev/gdb/alpha-tdep.c
--- src/gdb/alpha-tdep.c 2007-05-06 16:12:13.000000000 +0200
+++ dev/gdb/alpha-tdep.c 2007-06-08 06:08:53.000000000 +0200
@@ -116,7 +116,8 @@
{
/* 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 -urN src/gdb/arch-utils.c dev/gdb/arch-utils.c
--- src/gdb/arch-utils.c 2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/arch-utils.c 2007-06-08 06:04:49.000000000 +0200
@@ -88,8 +88,8 @@
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 -urN src/gdb/arm-tdep.c dev/gdb/arm-tdep.c
--- src/gdb/arm-tdep.c 2007-05-31 22:58:08.000000000 +0200
+++ dev/gdb/arm-tdep.c 2007-06-08 06:09:34.000000000 +0200
@@ -1211,7 +1211,8 @@
{
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 @@
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 -urN src/gdb/dwarf2-frame.c dev/gdb/dwarf2-frame.c
--- src/gdb/dwarf2-frame.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/dwarf2-frame.c 2007-06-08 06:11:10.000000000 +0200
@@ -339,7 +339,8 @@
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 -urN src/gdb/dwarf2loc.c dev/gdb/dwarf2loc.c
--- src/gdb/dwarf2loc.c 2007-05-18 21:42:42.000000000 +0200
+++ dev/gdb/dwarf2loc.c 2007-06-08 06:04:49.000000000 +0200
@@ -452,7 +452,8 @@
{
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 -urN src/gdb/findvar.c dev/gdb/findvar.c
--- src/gdb/findvar.c 2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/findvar.c 2007-06-08 06:12:23.000000000 +0200
@@ -708,12 +708,14 @@
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 -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h 2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/gdbarch.h 2007-06-08 06:04:49.000000000 +0200
@@ -409,12 +409,6 @@
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 -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh 2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/gdbarch.sh 2007-06-08 06:04:49.000000000 +0200
@@ -454,7 +454,7 @@
# 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 -urN src/gdb/hppa-hpux-nat.c dev/gdb/hppa-hpux-nat.c
--- src/gdb/hppa-hpux-nat.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/hppa-hpux-nat.c 2007-06-08 06:04:49.000000000 +0200
@@ -110,7 +110,8 @@
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 @@
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 @@
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 @@
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 -urN src/gdb/hppa-linux-nat.c dev/gdb/hppa-linux-nat.c
--- src/gdb/hppa-linux-nat.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/hppa-linux-nat.c 2007-06-08 06:04:49.000000000 +0200
@@ -235,7 +235,8 @@
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 @@
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 -urN src/gdb/i386gnu-nat.c dev/gdb/i386gnu-nat.c
--- src/gdb/i386gnu-nat.c 2007-05-06 16:34:37.000000000 +0200
+++ dev/gdb/i386gnu-nat.c 2007-06-08 06:04:49.000000000 +0200
@@ -150,7 +150,8 @@
}
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 @@
/* 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 @@
}
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 -urN src/gdb/i386-linux-nat.c dev/gdb/i386-linux-nat.c
--- src/gdb/i386-linux-nat.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/i386-linux-nat.c 2007-06-08 06:04:50.000000000 +0200
@@ -162,7 +162,8 @@
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 @@
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 -urN src/gdb/ia64-linux-nat.c dev/gdb/ia64-linux-nat.c
--- src/gdb/ia64-linux-nat.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/ia64-linux-nat.c 2007-06-08 06:04:50.000000000 +0200
@@ -704,7 +704,8 @@
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 @@
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 -urN src/gdb/infcmd.c dev/gdb/infcmd.c
--- src/gdb/infcmd.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/infcmd.c 2007-06-08 06:13:35.000000000 +0200
@@ -1628,11 +1628,13 @@
/* 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 -urN src/gdb/inf-ptrace.c dev/gdb/inf-ptrace.c
--- src/gdb/inf-ptrace.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/inf-ptrace.c 2007-06-08 06:04:50.000000000 +0200
@@ -650,7 +650,8 @@
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 @@
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 -urN src/gdb/m68klinux-nat.c dev/gdb/m68klinux-nat.c
--- src/gdb/m68klinux-nat.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/m68klinux-nat.c 2007-06-08 06:04:50.000000000 +0200
@@ -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 @@
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 @@
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 -urN src/gdb/mi/mi-main.c dev/gdb/mi/mi-main.c
--- src/gdb/mi/mi-main.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/mi/mi-main.c 2007-06-08 06:14:19.000000000 +0200
@@ -286,10 +286,10 @@
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 @@
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_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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 -urN src/gdb/mips-tdep.c dev/gdb/mips-tdep.c
--- src/gdb/mips-tdep.c 2007-06-08 05:38:50.000000000 +0200
+++ dev/gdb/mips-tdep.c 2007-06-08 06:18:20.000000000 +0200
@@ -537,7 +537,8 @@
/* 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 @@
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 @@
/* 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 @@
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 @@
/* 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 @@
+ 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 @@
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 @@
+ 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 @@
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 @@
/* 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 -urN src/gdb/mn10300-tdep.c dev/gdb/mn10300-tdep.c
--- src/gdb/mn10300-tdep.c 2007-02-27 21:17:19.000000000 +0100
+++ dev/gdb/mn10300-tdep.c 2007-06-08 06:04:50.000000000 +0200
@@ -1078,7 +1078,7 @@
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 -urN src/gdb/mt-tdep.c dev/gdb/mt-tdep.c
--- src/gdb/mt-tdep.c 2007-05-06 21:37:30.000000000 +0200
+++ dev/gdb/mt-tdep.c 2007-06-08 06:19:14.000000000 +0200
@@ -661,8 +661,11 @@
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 @@
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 @@
/* 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 -urN src/gdb/ppc-linux-nat.c dev/gdb/ppc-linux-nat.c
--- src/gdb/ppc-linux-nat.c 2007-05-31 22:58:08.000000000 +0200
+++ dev/gdb/ppc-linux-nat.c 2007-06-08 06:04:50.000000000 +0200
@@ -381,7 +381,7 @@
{
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 @@
{
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 -urN src/gdb/printcmd.c dev/gdb/printcmd.c
--- src/gdb/printcmd.c 2007-05-16 15:48:22.000000000 +0200
+++ dev/gdb/printcmd.c 2007-06-08 06:04:50.000000000 +0200
@@ -1113,7 +1113,8 @@
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 @@
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 @@
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 @@
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 -urN src/gdb/regcache.c dev/gdb/regcache.c
--- src/gdb/regcache.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/regcache.c 2007-06-08 06:04:50.000000000 +0200
@@ -1027,7 +1027,7 @@
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 -urN src/gdb/reggroups.c dev/gdb/reggroups.c
--- src/gdb/reggroups.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/reggroups.c 2007-06-08 06:04:50.000000000 +0200
@@ -159,8 +159,8 @@
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 -urN src/gdb/remote.c dev/gdb/remote.c
--- src/gdb/remote.c 2007-06-08 05:38:51.000000000 +0200
+++ dev/gdb/remote.c 2007-06-08 06:04:50.000000000 +0200
@@ -260,7 +260,8 @@
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 -urN src/gdb/remote-sim.c dev/gdb/remote-sim.c
--- src/gdb/remote-sim.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/remote-sim.c 2007-06-08 06:04:50.000000000 +0200
@@ -317,7 +317,7 @@
{
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 -urN src/gdb/rs6000-tdep.c dev/gdb/rs6000-tdep.c
--- src/gdb/rs6000-tdep.c 2007-05-31 22:58:08.000000000 +0200
+++ dev/gdb/rs6000-tdep.c 2007-06-08 06:04:50.000000000 +0200
@@ -2092,8 +2092,8 @@
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 -urN src/gdb/sh64-tdep.c dev/gdb/sh64-tdep.c
--- src/gdb/sh64-tdep.c 2007-06-08 05:38:51.000000000 +0200
+++ dev/gdb/sh64-tdep.c 2007-06-08 06:23:31.000000000 +0200
@@ -1968,14 +1968,16 @@
/* 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 @@
{
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 @@
{
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 @@
{
/* 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 @@
{
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 -urN src/gdb/sh-tdep.c dev/gdb/sh-tdep.c
--- src/gdb/sh-tdep.c 2007-05-31 22:58:08.000000000 +0200
+++ dev/gdb/sh-tdep.c 2007-06-08 06:04:50.000000000 +0200
@@ -1890,8 +1890,8 @@
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 -urN src/gdb/stack.c dev/gdb/stack.c
--- src/gdb/stack.c 2007-06-08 05:38:51.000000000 +0200
+++ dev/gdb/stack.c 2007-06-08 06:04:50.000000000 +0200
@@ -844,7 +844,7 @@
/* 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 @@
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 @@
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 -urN src/gdb/target.c dev/gdb/target.c
--- src/gdb/target.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/target.c 2007-06-08 06:20:11.000000000 +0200
@@ -2156,8 +2156,10 @@
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 -urN src/gdb/tracepoint.c dev/gdb/tracepoint.c
--- src/gdb/tracepoint.c 2007-05-31 19:31:37.000000000 +0200
+++ dev/gdb/tracepoint.c 2007-06-08 06:21:58.000000000 +0200
@@ -2443,7 +2443,8 @@
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 @@
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 @@
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),