parse.c (build_parse): don't write off the end of the std_regs array.
authorDavid Taylor <taylor@redhat.com>
Mon, 7 Aug 2000 14:27:36 +0000 (14:27 +0000)
committerDavid Taylor <taylor@redhat.com>
Mon, 7 Aug 2000 14:27:36 +0000 (14:27 +0000)
gdb/ChangeLog
gdb/parse.c

index aad8daad8b9106c7b152c6fa3072e4f937c4ccf6..6c687cb83d4b413a5618795de85c7e174cddd29d 100644 (file)
@@ -1,3 +1,8 @@
+Mon Aug  7 10:24:30 2000  David Taylor  <taylor@texas.cygnus.com>
+
+       * parse.c (build_parse): don't write off the end of the std_regs
+       array.
+
 2000-05-21  Mark Kettenis  <kettenis@gnu.org>
 
        * solib.c (bfd_lookup_symbol): Fall back on the dynamic symbol
index 166446a4016547312c6a2bbb131da3bdbaef38da..5ea053459ca33218cdddb3509514c243ca327888 100644 (file)
@@ -1331,24 +1331,36 @@ build_parse (void)
   i = 0;
   /* fill it in */
 #ifdef PC_REGNUM
-  std_regs[i].name = "pc";
-  std_regs[i].regnum = PC_REGNUM;
-  i++;
+  if (PC_REGNUM >= 0)
+    {
+      std_regs[i].name = "pc";
+      std_regs[i].regnum = PC_REGNUM;
+      i++;
+    }
 #endif
 #ifdef FP_REGNUM
-  std_regs[i].name = "fp";
-  std_regs[i].regnum = FP_REGNUM;
-  i++;
+  if (FP_REGNUM >= 0)
+    {
+      std_regs[i].name = "fp";
+      std_regs[i].regnum = FP_REGNUM;
+      i++;
+    }
 #endif
 #ifdef SP_REGNUM
-  std_regs[i].name = "sp";
-  std_regs[i].regnum = SP_REGNUM;
-  i++;
+  if (SP_REGNUM >= 0)
+    {
+      std_regs[i].name = "sp";
+      std_regs[i].regnum = SP_REGNUM;
+      i++;
+    }
 #endif
 #ifdef PS_REGNUM
-  std_regs[i].name = "ps";
-  std_regs[i].regnum = PS_REGNUM;
-  i++;
+  if (PS_REGNUM >= 0)
+    {
+      std_regs[i].name = "ps";
+      std_regs[i].regnum = PS_REGNUM;
+      i++;
+    }
 #endif
   memset (&std_regs[i], 0, sizeof (std_regs[i]));
 }