2000-12-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Fri, 15 Dec 2000 21:44:35 +0000 (21:44 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Fri, 15 Dec 2000 21:44:35 +0000 (21:44 +0000)
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
  sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs): SR_REGNUM is
  now part of gdbarch_tdep structure.
(sh_gdbarch_init): Initialize SR_REGNUM.

* config/sh/tm-sh.h (struct gdbarch_tdep): Add field SR_REGNUM.

gdb/ChangeLog
gdb/config/sh/tm-sh.h
gdb/sh-tdep.c

index 2c012d386a7373ab6ea645c490ebe375751e3f10..a537ceb7442584dd0bb311f24d8b9e5f59479963 100644 (file)
@@ -1,5 +1,12 @@
 2000-12-15  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>
 
+       * sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
+       sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs): SR_REGNUM is
+       now part of gdbarch_tdep structure.
+       (sh_gdbarch_init): Initialize SR_REGNUM.
+
+       * config/sh/tm-sh.h (struct gdbarch_tdep): Add field SR_REGNUM.
+
        * sh-tdep.c (sh_do_pseudo_register): Indent properly. Call
        do_dr_register_info() only for DR registers.
        (sh_sh4_register_name): Add comments with numbers.
index 5817c0baee6bee1b4cd2c65facd6cb3a56299436..34495e7f3c6d9c3a14da6935976540345ed9f4ec 100644 (file)
@@ -27,6 +27,7 @@ struct gdbarch_tdep
   {
     int FPUL_REGNUM;  /*                       sh3e, sh4 */
     int FPSCR_REGNUM; /*                       sh3e, sh4 */
+    int SR_REGNUM;    /* sh-dsp, sh3, sh3-dsp, sh3e, sh4 */
     int DSR_REGNUM;   /* sh-dsp,      sh3-dsp            */
     int FP_LAST_REGNUM; /*                     sh3e, sh4 */
     int A0G_REGNUM;   /* sh-dsp,      sh3-dsp            */
@@ -61,8 +62,7 @@ enum
     GBR_REGNUM = 18,
     VBR_REGNUM = 19,
     MACH_REGNUM = 20,
-    MACL_REGNUM = 21,
-    SR_REGNUM = 22
+    MACL_REGNUM = 21
   };
 
 /* Define DO_REGISTERS_INFO() to do machine-specific formatting
index 013461dfe2e90b5ee3a6751a04d69702ebce4087..5e89dd9fb8bf50008badc689f416f47d178e3c0a 100644 (file)
@@ -1096,7 +1096,7 @@ sh_generic_show_regs (void)
 {
   printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
                   paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
+                  (long) read_register (gdbarch_tdep (current_gdbarch)->SR_REGNUM),
                   (long) read_register (PR_REGNUM),
                   (long) read_register (MACH_REGNUM),
                   (long) read_register (MACL_REGNUM));
@@ -1130,7 +1130,7 @@ sh3_show_regs (void)
 {
   printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
                   paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
+                  (long) read_register (gdbarch_tdep (current_gdbarch)->SR_REGNUM),
                   (long) read_register (PR_REGNUM),
                   (long) read_register (MACH_REGNUM),
                   (long) read_register (MACL_REGNUM));
@@ -1168,7 +1168,7 @@ sh3e_show_regs (void)
 {
   printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
                   paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
+                  (long) read_register (gdbarch_tdep (current_gdbarch)->SR_REGNUM),
                   (long) read_register (PR_REGNUM),
                   (long) read_register (MACH_REGNUM),
                   (long) read_register (MACL_REGNUM));
@@ -1227,7 +1227,7 @@ sh3_dsp_show_regs (void)
 {
   printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
                   paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
+                  (long) read_register (gdbarch_tdep (current_gdbarch)->SR_REGNUM),
                   (long) read_register (PR_REGNUM),
                   (long) read_register (MACH_REGNUM),
                   (long) read_register (MACL_REGNUM));
@@ -1285,7 +1285,7 @@ sh4_show_regs (void)
   int pr = read_register (gdbarch_tdep (current_gdbarch)->FPSCR_REGNUM) & 0x80000;
   printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
                   paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
+                  (long) read_register (gdbarch_tdep (current_gdbarch)->SR_REGNUM),
                   (long) read_register (PR_REGNUM),
                   (long) read_register (MACH_REGNUM),
                   (long) read_register (MACL_REGNUM));
@@ -1348,7 +1348,7 @@ sh_dsp_show_regs (void)
 {
   printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
                   paddr (read_register (PC_REGNUM)),
-                  (long) read_register (SR_REGNUM),
+                  (long) read_register (gdbarch_tdep (current_gdbarch)->SR_REGNUM),
                   (long) read_register (PR_REGNUM),
                   (long) read_register (MACH_REGNUM),
                   (long) read_register (MACL_REGNUM));
@@ -1881,6 +1881,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      statement below. */
   tdep->FPUL_REGNUM = -1;
   tdep->FPSCR_REGNUM = -1;
+  tdep->SR_REGNUM = 22;
   tdep->DSR_REGNUM = -1;
   tdep->FP_LAST_REGNUM = -1;
   tdep->A0G_REGNUM = -1;