* gdbarch.sh (PS_REGNUM): Add. Document. Default to -1.
authorAndrew Cagney <cagney@redhat.com>
Sat, 6 Apr 2002 20:50:10 +0000 (20:50 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 6 Apr 2002 20:50:10 +0000 (20:50 +0000)
* gdbarch.c, gdbarch.h: Re-generate.

gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh

index fc0ad95c584d53bad03520249d47fe4fea810b86..ce646ae473d43b5162a75d1c3b12315849fdd8a2 100644 (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''
index 90118d6e41fe6fc5febc9c704fcf34d1395075e0..fa9054bc57fc539aa573766c6599f26a5a11a76a 100644 (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)
 {
index ed87fa0bc164d79a51e6e901875f99b246711fb7..039ba59773599d7263578c55f6341e339c550d0c 100644 (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)
index 950dcf81d52be68eb744c960d54406e48b45a7ba..9c35694c14d731c1757a3147b5e48cd10881a4bd 100755 (executable)
@@ -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
This page took 0.034298 seconds and 4 git commands to generate.