From: Andrew Cagney Date: Sun, 7 Apr 2002 02:16:46 +0000 (+0000) Subject: * gdbarch.sh (FP_REGNUM, PC_REGNUM, SP_REGNUM): Allow default of X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1200cd6e7e85a1d1ba2c04df21fe6a00e1514c49;p=binutils-gdb.git * gdbarch.sh (FP_REGNUM, PC_REGNUM, SP_REGNUM): Allow default of -1. Update comment. * gdbarch.h, gdbarch.c: Re-generate. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9893658ab97..271ada8e573 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-04-06 Andrew Cagney + + * gdbarch.sh (FP_REGNUM, PC_REGNUM, SP_REGNUM): Allow default of + -1. Update comment. + * gdbarch.h, gdbarch.c: Re-generate. + 2002-04-07 Andreas Schwab * m68klinux-nat.c (fill_fpregset): Properly pass address of diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index fa9054bc57f..1775d8b27bc 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -294,9 +294,9 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, - 0, - 0, + -1, + -1, + -1, -1, 0, 0, @@ -586,15 +586,9 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->num_regs == -1)) fprintf_unfiltered (log, "\n\tnum_regs"); /* Skip verify of num_pseudo_regs, invalid_p == 0 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->sp_regnum == -1)) - fprintf_unfiltered (log, "\n\tsp_regnum"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->fp_regnum == -1)) - fprintf_unfiltered (log, "\n\tfp_regnum"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->pc_regnum == -1)) - fprintf_unfiltered (log, "\n\tpc_regnum"); + /* Skip verify of sp_regnum, invalid_p == 0 */ + /* Skip verify of fp_regnum, invalid_p == 0 */ + /* Skip verify of pc_regnum, invalid_p == 0 */ /* Skip verify of ps_regnum, invalid_p == 0 */ /* Skip verify of fp0_regnum, invalid_p == 0 */ /* Skip verify of npc_regnum, invalid_p == 0 */ @@ -2547,9 +2541,7 @@ set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int gdbarch_sp_regnum (struct gdbarch *gdbarch) { - if (gdbarch->sp_regnum == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_sp_regnum invalid"); + /* Skip verify of sp_regnum, invalid_p == 0 */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); return gdbarch->sp_regnum; @@ -2565,9 +2557,7 @@ set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int gdbarch_fp_regnum (struct gdbarch *gdbarch) { - if (gdbarch->fp_regnum == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_fp_regnum invalid"); + /* Skip verify of fp_regnum, invalid_p == 0 */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n"); return gdbarch->fp_regnum; @@ -2583,9 +2573,7 @@ set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int gdbarch_pc_regnum (struct gdbarch *gdbarch) { - if (gdbarch->pc_regnum == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_pc_regnum invalid"); + /* Skip verify of pc_regnum, invalid_p == 0 */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); return gdbarch->pc_regnum; diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 039ba597735..f68584df63a 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -458,9 +458,12 @@ extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo /* 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. */ + all (-1). */ + +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM) +#define SP_REGNUM (-1) +#endif extern int gdbarch_sp_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); @@ -473,6 +476,11 @@ extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FP_REGNUM) +#define FP_REGNUM (-1) +#endif + extern int gdbarch_fp_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM) @@ -484,6 +492,11 @@ extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM) +#define PC_REGNUM (-1) +#endif + extern int gdbarch_pc_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM) diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 9c35694c14d..645ca238e2e 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -434,12 +434,10 @@ 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 +# all (-1). +v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0 +v:2:FP_REGNUM:int:fp_regnum::::-1:-1::0 +v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0 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