pointer.
* gdbarch.h, gdbarch.c: Regenerate.
* config/mips/tm-mips.h (mips_register_name): Update.
* i386-tdep.h (i386_register_name): Update.
* mips-tdep.c (mips_register_name): Update
* alpha-tdep.c (alpha_register_name): Update.
* arch-utils.c (legacy_register_name): Update.
* arch-utils.h (legacy_register_name): Update.
* avr-tdep.c (avr_register_name): Update.
* ia64-tdep.c (ia64_register_name): Update.
* i386-tdep.c (i386_register_name): Update.
* sparc-tdep.c (sparc32_register_name): Update.
(sparc64_register_name): Update.
(sparclite_register_name): Update.
(sparclet_register_name):
* sh-tdep.c (sh_generic_register_name): Update.
(sh_sh_register_name): Update.
(sh_sh3_register_name): Update.
(sh_sh3e_register_name): Update.
(sh_sh_dsp_register_name): Update.
(sh_sh3_dsp_register_name): Update.
(sh_sh4_register_name): Update.
(sh_sh64_register_name): Update.
* s390-tdep.c (s390_register_name): Update.
* rs6000-tdep.c (rs6000_register_name): Update.
* ns32k-tdep.c (ns32k_register_name_32082): Update.
(ns32k_register_name_32382): Update.
* d10v-tdep.c (d10v_ts2_register_name): Update.
(d10v_ts3_register_name): Update.
* xstormy16-tdep.c (xstormy16_register_name): Update.
* vax-tdep.c (vax_register_name): Update.
* v850-tdep.c (v850_register_name): Update.
* m68hc11-tdep.c (m68hc11_register_name): Update.
* mn10300-tdep.c (mn10300_generic_register_name): Update.
(am33_register_name): Update.
+2002-06-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (REGISTER_NAME): Change return type a constant string
+ pointer.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * config/mips/tm-mips.h (mips_register_name): Update.
+ * i386-tdep.h (i386_register_name): Update.
+ * mips-tdep.c (mips_register_name): Update
+ * alpha-tdep.c (alpha_register_name): Update.
+ * arch-utils.c (legacy_register_name): Update.
+ * arch-utils.h (legacy_register_name): Update.
+ * avr-tdep.c (avr_register_name): Update.
+ * ia64-tdep.c (ia64_register_name): Update.
+ * i386-tdep.c (i386_register_name): Update.
+ * sparc-tdep.c (sparc32_register_name): Update.
+ (sparc64_register_name): Update.
+ (sparclite_register_name): Update.
+ (sparclet_register_name): Update.
+ * sh-tdep.c (sh_generic_register_name): Update.
+ (sh_sh_register_name): Update.
+ (sh_sh3_register_name): Update.
+ (sh_sh3e_register_name): Update.
+ (sh_sh_dsp_register_name): Update.
+ (sh_sh3_dsp_register_name): Update.
+ (sh_sh4_register_name): Update.
+ (sh_sh64_register_name): Update.
+ * s390-tdep.c (s390_register_name): Update.
+ * rs6000-tdep.c (rs6000_register_name): Update.
+ * ns32k-tdep.c (ns32k_register_name_32082): Update.
+ (ns32k_register_name_32382): Update.
+ * d10v-tdep.c (d10v_ts2_register_name): Update.
+ (d10v_ts3_register_name): Update.
+ * xstormy16-tdep.c (xstormy16_register_name): Update.
+ * vax-tdep.c (vax_register_name): Update.
+ * v850-tdep.c (v850_register_name): Update.
+ * m68hc11-tdep.c (m68hc11_register_name): Update.
+ * mn10300-tdep.c (mn10300_generic_register_name): Update.
+ (am33_register_name): Update.
+
2002-06-17 Grace Sainsbury <graces@redhat.com>
* m68k-tdep.c: Reindented.
}
\f
-static char *
+static const char *
alpha_register_name (int regno)
{
static char *register_names[] =
return 0;
}
-char *
+const char *
legacy_register_name (int i)
{
#ifdef REGISTER_NAMES
extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not;
/* Map onto old REGISTER_NAMES. */
-extern char *legacy_register_name (int i);
+extern const char *legacy_register_name (int i);
/* Accessor for old global function pointer for disassembly. */
extern int legacy_print_insn (bfd_vma vma, disassemble_info *info);
/* Lookup the name of a register given it's number. */
-static char *
+static const char *
avr_register_name (int regnum)
{
static char *register_names[] = {
/* Given the register index, return the name of the corresponding
register. */
-extern char *mips_register_name (int regnr);
+extern const char *mips_register_name (int regnr);
#define REGISTER_NAME(i) mips_register_name (i)
/* Initializer for an array of names of registers.
TS2_A0_REGNUM = 35
};
-static char *
+static const char *
d10v_ts2_register_name (int reg_nr)
{
static char *register_names[] =
TS3_A0_REGNUM = 32
};
-static char *
+static const char *
d10v_ts3_register_name (int reg_nr)
{
static char *register_names[] =
gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
}
-char *
+const char *
gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
{
gdb_assert (gdbarch != NULL);
#define REGISTER_NAME(regnr) (legacy_register_name (regnr))
#endif
-typedef char * (gdbarch_register_name_ftype) (int regnr);
-extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
+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 (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
#error "Non multi-arch definition of REGISTER_NAME"
# to map one to one onto the sdb register numbers.
f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
-f:2:REGISTER_NAME:char *:register_name:int regnr:regnr:::legacy_register_name::0
+f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_name::0
v:2:REGISTER_SIZE:int:register_size::::0:-1
v:2:REGISTER_BYTES:int:register_bytes::::0:-1
f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0
/* Return the name of register REG. */
-char *
+const char *
i386_register_name (int reg)
{
if (reg < 0)
+ I386_SIZEOF_XREGS)
/* Return the name of register REG. */
-extern char *i386_register_name (int reg);
+extern char const *i386_register_name (int reg);
/* Return the offset into the register array of the start of register
number REG. */
#define FIND_GLOBAL_POINTER \
(gdbarch_tdep (current_gdbarch)->find_global_pointer)
-static char *
+static const char *
ia64_register_name (int reg)
{
return ia64_register_names[reg];
}
}
-static char *
+static const char *
m68hc11_register_name (int reg_nr)
{
if (reg_nr < 0)
char *mips_generic_reg_names[] = MIPS_REGISTER_NAMES;
char **mips_processor_reg_names = mips_generic_reg_names;
-char *
+const char *
mips_register_name (int i)
{
return mips_processor_reg_names[i];
return regs[reg];
}
-static char *
+static const char *
mn10300_generic_register_name (int reg)
{
static char *regs[] =
}
-static char *
+static const char *
am33_register_name (int reg)
{
static char *regs[] =
static int ns32k_localcount (CORE_ADDR enter_pc);
static void flip_bytes (void *, int);
-static char *
+static const char *
ns32k_register_name_32082 (int regno)
{
static char *register_names[] =
return (register_names[regno]);
}
-static char *
+static const char *
ns32k_register_name_32382 (int regno)
{
static char *register_names[] =
/* Return the name of register number N, or null if no such register exists
in the current architecture. */
-static char *
+static const char *
rs6000_register_name (int n)
{
struct gdbarch_tdep *tdep = TDEP;
-char *
+const char *
s390_register_name (int reg_nr)
{
static char *register_names[] = {
int f_offset;
};
-static char *
+static const char *
sh_generic_register_name (int reg_nr)
{
static char *register_names[] =
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh_register_name (int reg_nr)
{
static char *register_names[] =
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh3_register_name (int reg_nr)
{
static char *register_names[] =
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh3e_register_name (int reg_nr)
{
static char *register_names[] =
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh_dsp_register_name (int reg_nr)
{
static char *register_names[] =
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh3_dsp_register_name (int reg_nr)
{
static char *register_names[] =
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh4_register_name (int reg_nr)
{
static char *register_names[] =
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh64_register_name (int reg_nr)
{
static char *register_names[] =
/* MULTI_ARCH support */
-static char *
+static const char *
sparc32_register_name (int regno)
{
static char *register_names[] =
return register_names[regno];
}
-static char *
+static const char *
sparc64_register_name (int regno)
{
static char *register_names[] =
return register_names[regno];
}
-static char *
+static const char *
sparclite_register_name (int regno)
{
static char *register_names[] =
return register_names[regno];
}
-static char *
+static const char *
sparclet_register_name (int regno)
{
static char *register_names[] =
/* Function: v850_register_name
Returns the name of the v850/v850e register N. */
-static char *
+static const char *
v850_register_name (int regnum)
{
if (regnum < 0 || regnum >= E_NUM_REGS)
static unsigned char *print_insn_arg ();
\f
-static char *
+static const char *
vax_register_name (int regno)
{
static char *register_names[] =
/* Function: xstormy16_register_name
Returns the name of the standard Xstormy16 register N. */
-static char *
+static const char *
xstormy16_register_name (int regnum)
{
static char *register_names[] = {