* gdbarch.sh (PS_REGNUM): Add. Document. Default to -1.

* gdbarch.c, gdbarch.h: Re-generate.
This commit is contained in:
Andrew Cagney 2002-04-06 20:50:10 +00:00
parent 25f1b00810
commit c2169756a8
4 changed files with 62 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2002-04-06 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (PS_REGNUM): Add. Document. Default to -1.
* gdbarch.c, gdbarch.h: Re-generate.
2002-04-06 Andrew Cagney <ac131313@redhat.com>
* symtab.c (lookup_symtab): Remove ``const'' from ``rp''

View file

@ -151,6 +151,7 @@ struct gdbarch
int sp_regnum;
int fp_regnum;
int pc_regnum;
int ps_regnum;
int fp0_regnum;
int npc_regnum;
int nnpc_regnum;
@ -296,6 +297,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
-1,
0,
0,
0,
@ -459,6 +461,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->sp_regnum = -1;
current_gdbarch->fp_regnum = -1;
current_gdbarch->pc_regnum = -1;
current_gdbarch->ps_regnum = -1;
current_gdbarch->fp0_regnum = -1;
current_gdbarch->npc_regnum = -1;
current_gdbarch->nnpc_regnum = -1;
@ -592,6 +595,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->pc_regnum == -1))
fprintf_unfiltered (log, "\n\tpc_regnum");
/* Skip verify of ps_regnum, invalid_p == 0 */
/* Skip verify of fp0_regnum, invalid_p == 0 */
/* Skip verify of npc_regnum, invalid_p == 0 */
/* Skip verify of nnpc_regnum, invalid_p == 0 */
@ -1532,6 +1536,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->prologue_frameless_p
/*PROLOGUE_FRAMELESS_P ()*/);
#endif
#ifdef PS_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: PS_REGNUM # %s\n",
XSTRING (PS_REGNUM));
fprintf_unfiltered (file,
"gdbarch_dump: PS_REGNUM = %d\n",
PS_REGNUM);
#endif
#ifdef PUSH_ARGUMENTS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@ -2586,6 +2598,22 @@ set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
gdbarch->pc_regnum = pc_regnum;
}
int
gdbarch_ps_regnum (struct gdbarch *gdbarch)
{
/* Skip verify of ps_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
return gdbarch->ps_regnum;
}
void
set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
int ps_regnum)
{
gdbarch->ps_regnum = ps_regnum;
}
int
gdbarch_fp0_regnum (struct gdbarch *gdbarch)
{

View file

@ -456,6 +456,12 @@ extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo
#endif
#endif
/* GDB's standard (or well known) register numbers. These can map onto
a real register or a pseudo (computed) register or not be defined at
all (-1). FIXME: cagney/2002-04-05: As of the time of writing, only
the PS_REGNUM was optional - code still depends on the others (fp,
pc, sp) designating registers. */
extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
@ -489,6 +495,22 @@ extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
#endif
#endif
/* Default (value) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM)
#define PS_REGNUM (-1)
#endif
extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM)
#error "Non multi-arch definition of PS_REGNUM"
#endif
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PS_REGNUM)
#define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch))
#endif
#endif
/* Default (value) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
#define FP0_REGNUM (-1)

View file

@ -431,9 +431,16 @@ v:2:NUM_REGS:int:num_regs::::0:-1
# These pseudo-registers may be aliases for other registers,
# combinations of other registers, or they may be computed by GDB.
v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0:::
# GDB's standard (or well known) register numbers. These can map onto
# a real register or a pseudo (computed) register or not be defined at
# all (-1). FIXME: cagney/2002-04-05: As of the time of writing, only
# the PS_REGNUM was optional - code still depends on the others (fp,
# pc, sp) designating registers.
v:2:SP_REGNUM:int:sp_regnum::::0:-1
v:2:FP_REGNUM:int:fp_regnum::::0:-1
v:2:PC_REGNUM:int:pc_regnum::::0:-1
v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0
v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1::0