2003-07-03 Andrew Cagney <cagney@redhat.com>

* gdbarch.sh (REGISTER_NAME): Do not supply a default.
	* gdbarch.h, gdbarch.c: Re-generate.
	* config/sparc/tm-sparc.h (REGISTER_NAME): Define.
	(legacy_register_name): Declare.
	* config/sparc/tm-sp64.h (legacy_register_name): Declare.
	(REGISTER_NAME): Define.
	* sparc-tdep.c (legacy_register_name): New function.
	* config/pa/tm-hppa64.h (REGISTER_NAMES): Delete macro.
	(REGISTER_NAME): Define.
	(hppa64_register_name): Declare.
	* config/pa/tm-hppa.h (REGISTER_NAMES): Delete macro.
	* hppa-tdep.c (hppa_gdbarch_init): Set hppa_register_name.
	(hppa64_register_name): New function.
	(hppa_register_name): New function.
	* arch-utils.c (legacy_register_name): Delete.
	* arch-utils.h (legacy_register_name): Delete.
This commit is contained in:
Andrew Cagney 2003-07-03 22:14:42 +00:00
parent 38caaeec2b
commit e23457df3d
12 changed files with 125 additions and 63 deletions

View file

@ -1,3 +1,22 @@
2003-07-03 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (REGISTER_NAME): Do not supply a default.
* gdbarch.h, gdbarch.c: Re-generate.
* config/sparc/tm-sparc.h (REGISTER_NAME): Define.
(legacy_register_name): Declare.
* config/sparc/tm-sp64.h (legacy_register_name): Declare.
(REGISTER_NAME): Define.
* sparc-tdep.c (legacy_register_name): New function.
* config/pa/tm-hppa64.h (REGISTER_NAMES): Delete macro.
(REGISTER_NAME): Define.
(hppa64_register_name): Declare.
* config/pa/tm-hppa.h (REGISTER_NAMES): Delete macro.
* hppa-tdep.c (hppa_gdbarch_init): Set hppa_register_name.
(hppa64_register_name): New function.
(hppa_register_name): New function.
* arch-utils.c (legacy_register_name): Delete.
* arch-utils.h (legacy_register_name): Delete.
2003-07-03 Daniel Jacobowitz <drow@mvista.com>
* cli/cli-interp.c (cli_interpreter_resume): Update the

View file

@ -131,22 +131,6 @@ generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
return 0;
}
const char *
legacy_register_name (int i)
{
#ifdef REGISTER_NAMES
static char *names[] = REGISTER_NAMES;
if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
return NULL;
else
return names[i];
#else
internal_error (__FILE__, __LINE__,
"legacy_register_name: called.");
return NULL;
#endif
}
#if defined (CALL_DUMMY)
LONGEST legacy_call_dummy_words[] = CALL_DUMMY;
#else

View file

@ -55,9 +55,6 @@ extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_in
language family, so that case is irrelevant for C. */
extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not;
/* Map onto old REGISTER_NAMES. */
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);

View file

@ -54,28 +54,6 @@ const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr);
extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
#define PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer.
They are in rows of eight entries */
#define REGISTER_NAMES \
{"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", \
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
"r24", "r25", "r26", "dp", "ret0", "ret1", "sp", "r31", \
"sar", "pcoqh", "pcsqh", "pcoqt", "pcsqt", "eiem", "iir", "isr", \
"ior", "ipsw", "goto", "sr4", "sr0", "sr1", "sr2", "sr3", \
"sr5", "sr6", "sr7", "cr0", "cr8", "cr9", "ccr", "cr12", \
"cr13", "cr24", "cr25", "cr26", "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",\
"fpsr", "fpe1", "fpe2", "fpe3", "fpe4", "fpe5", "fpe6", "fpe7", \
"fr4", "fr4R", "fr5", "fr5R", "fr6", "fr6R", "fr7", "fr7R", \
"fr8", "fr8R", "fr9", "fr9R", "fr10", "fr10R", "fr11", "fr11R", \
"fr12", "fr12R", "fr13", "fr13R", "fr14", "fr14R", "fr15", "fr15R", \
"fr16", "fr16R", "fr17", "fr17R", "fr18", "fr18R", "fr19", "fr19R", \
"fr20", "fr20R", "fr21", "fr21R", "fr22", "fr22R", "fr23", "fr23R", \
"fr24", "fr24R", "fr25", "fr25R", "fr26", "fr26R", "fr27", "fr27R", \
"fr28", "fr28R", "fr29", "fr29R", "fr30", "fr30R", "fr31", "fr31R"}
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
and correspond to the general registers of the machine,

View file

@ -398,20 +398,8 @@ extern CORE_ADDR hppa_target_read_fp (void);
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer.
They are in rows of eight entries */
#undef REGISTER_NAMES
#define REGISTER_NAMES \
{"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", \
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
"r24", "r25", "r26", "dp", "ret0", "ret1", "sp", "r31", \
"sar", "pcoqh", "pcsqh", "pcoqt", "pcsqt", "eiem", "iir", "isr", \
"ior", "ipsw", "goto", "sr4", "sr0", "sr1", "sr2", "sr3", \
"sr5", "sr6", "sr7", "cr0", "cr8", "cr9", "ccr", "cr12", \
"cr13", "cr24", "cr25", "cr26", "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",\
"fpsr", "fpe1", "fpe2", "fpe3", "fr4", "fr5", "fr6", "fr7", \
"fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", \
"fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23", \
"fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"}
extern const char *hppa64_register_name (int i);
#define REGISTER_NAME hppa64_register_name
#undef FP0_REGNUM
#undef FP4_REGNUM

View file

@ -260,6 +260,8 @@ CORE_ADDR sparc64_push_arguments (int,
/* These are here at the end to simplify removing them if we have to. */ \
"icc", "xcc", "fcc0", "fcc1", "fcc2", "fcc3" \
}
extern const char *legacy_register_name (int i);
#define REGISTER_NAME legacy_register_name
#undef REG_STRUCT_HAS_ADDR
#define REG_STRUCT_HAS_ADDR(gcc_p,type) (TYPE_LENGTH (type) > 32)

View file

@ -158,6 +158,8 @@ extern int sparc_intreg_size (void);
\
"y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" \
}
extern const char *legacy_register_name (int i);
#define REGISTER_NAME legacy_register_name
/* Offset from address of function to start of its code.
Zero on most machines. */

View file

@ -514,7 +514,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->register_name = legacy_register_name;
current_gdbarch->deprecated_register_byte = generic_register_byte;
current_gdbarch->deprecated_register_raw_size = generic_register_size;
current_gdbarch->deprecated_register_virtual_size = generic_register_size;
@ -637,7 +636,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
/* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
/* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
/* Skip verify of register_name, invalid_p == 0 */
/* Skip verify of register_type, has predicate */
/* Skip verify of deprecated_register_virtual_type, has predicate */
/* Skip verify of deprecated_register_byte, has predicate */

View file

@ -589,11 +589,6 @@ extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_d
#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
#endif
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME)
#define REGISTER_NAME(regnr) (legacy_register_name (regnr))
#endif
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);

View file

@ -465,7 +465,7 @@ f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no
# 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:const char *:register_name:int regnr:regnr:::legacy_register_name::0
f::REGISTER_NAME:const char *:register_name:int regnr:regnr
# REGISTER_TYPE is a direct replacement for REGISTER_VIRTUAL_TYPE.
M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr::0:

View file

@ -678,6 +678,88 @@ hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
return breakpoint;
}
/* Return the name of a register. */
const char *
hppa_register_name (int i)
{
static char *names[] = {
"flags", "r1", "rp", "r3",
"r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11",
"r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19",
"r20", "r21", "r22", "r23",
"r24", "r25", "r26", "dp",
"ret0", "ret1", "sp", "r31",
"sar", "pcoqh", "pcsqh", "pcoqt",
"pcsqt", "eiem", "iir", "isr",
"ior", "ipsw", "goto", "sr4",
"sr0", "sr1", "sr2", "sr3",
"sr5", "sr6", "sr7", "cr0",
"cr8", "cr9", "ccr", "cr12",
"cr13", "cr24", "cr25", "cr26",
"mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",
"fpsr", "fpe1", "fpe2", "fpe3",
"fpe4", "fpe5", "fpe6", "fpe7",
"fr4", "fr4R", "fr5", "fr5R",
"fr6", "fr6R", "fr7", "fr7R",
"fr8", "fr8R", "fr9", "fr9R",
"fr10", "fr10R", "fr11", "fr11R",
"fr12", "fr12R", "fr13", "fr13R",
"fr14", "fr14R", "fr15", "fr15R",
"fr16", "fr16R", "fr17", "fr17R",
"fr18", "fr18R", "fr19", "fr19R",
"fr20", "fr20R", "fr21", "fr21R",
"fr22", "fr22R", "fr23", "fr23R",
"fr24", "fr24R", "fr25", "fr25R",
"fr26", "fr26R", "fr27", "fr27R",
"fr28", "fr28R", "fr29", "fr29R",
"fr30", "fr30R", "fr31", "fr31R"
};
if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
return NULL;
else
return names[i];
}
const char *
hppa64_register_name (int i)
{
static char *names[] = {
"flags", "r1", "rp", "r3",
"r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11",
"r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19",
"r20", "r21", "r22", "r23",
"r24", "r25", "r26", "dp",
"ret0", "ret1", "sp", "r31",
"sar", "pcoqh", "pcsqh", "pcoqt",
"pcsqt", "eiem", "iir", "isr",
"ior", "ipsw", "goto", "sr4",
"sr0", "sr1", "sr2", "sr3",
"sr5", "sr6", "sr7", "cr0",
"cr8", "cr9", "ccr", "cr12",
"cr13", "cr24", "cr25", "cr26",
"mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",
"fpsr", "fpe1", "fpe2", "fpe3",
"fr4", "fr5", "fr6", "fr7",
"fr8", "fr9", "fr10", "fr11",
"fr12", "fr13", "fr14", "fr15",
"fr16", "fr17", "fr18", "fr19",
"fr20", "fr21", "fr22", "fr23",
"fr24", "fr25", "fr26", "fr27",
"fr28", "fr29", "fr30", "fr31"
};
if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
return NULL;
else
return names[i];
}
/* Return the adjustment necessary to make for addresses on the stack
as presented by hpread.c.
@ -4943,6 +5025,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
set_gdbarch_deprecated_register_virtual_type (gdbarch, hppa_register_virtual_type);
set_gdbarch_register_name (gdbarch, hppa_register_name);
set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
set_gdbarch_deprecated_extract_return_value (gdbarch,
hppa_extract_return_value);

View file

@ -2871,6 +2871,22 @@ sparc_print_extra_frame_info (struct frame_info *fi)
/* MULTI_ARCH support */
const char *
legacy_register_name (int i)
{
#ifdef REGISTER_NAMES
static char *names[] = REGISTER_NAMES;
if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
return NULL;
else
return names[i];
#else
internal_error (__FILE__, __LINE__,
"legacy_register_name: called.");
return NULL;
#endif
}
static const char *
sparc32_register_name (int regno)
{