* s390-tdep.c (s390_frame_chain): Remember that the SP's element
authorJim Blandy <jimb@codesourcery.com>
Wed, 28 Nov 2001 03:36:36 +0000 (03:36 +0000)
committerJim Blandy <jimb@codesourcery.com>
Wed, 28 Nov 2001 03:36:36 +0000 (03:36 +0000)
of the frame's saved_regs array is special.

gdb/ChangeLog
gdb/s390-tdep.c

index 83a4af9a82dc8814b1d06e2e779f1c52af7937d9..07b13ee24b527b88b932d465700fff108269b5e2 100644 (file)
@@ -1,5 +1,8 @@
 2001-11-27  Jim Blandy  <jimb@redhat.com>
 
+       * s390-tdep.c (s390_frame_chain): Remember that the SP's element
+       of the frame's saved_regs array is special.
+
        * s390-tdep.c (register_names): Call the general-purpose registers
        `r0' -- `r15', and the floating-point registers `f0' -- `f15', to
        match the assembly language.
index be50a9224633a9966ceea544214a2b2762a89fe4..afefc7f69dbf8d1e4d68a75e0bdd000d1acfb31c 100644 (file)
@@ -974,18 +974,24 @@ s390_frame_chain (struct frame_info *thisframe)
        {
          if (thisframe->saved_regs)
            {
-
              int regno;
 
-             regno =
-               ((prev_fextra_info.frame_pointer_saved_pc
-                 && thisframe->
-                 saved_regs[S390_FRAME_REGNUM]) ? S390_FRAME_REGNUM :
-                S390_SP_REGNUM);
+              if (prev_fextra_info.frame_pointer_saved_pc
+                  && thisframe->saved_regs[S390_FRAME_REGNUM])
+                regno = S390_FRAME_REGNUM;
+              else
+                regno = S390_SP_REGNUM;
+
              if (thisframe->saved_regs[regno])
-               prev_fp =
-                 read_memory_integer (thisframe->saved_regs[regno],
-                                      S390_GPR_SIZE);
+                {
+                  /* The SP's entry of `saved_regs' is special.  */
+                  if (regno == S390_SP_REGNUM)
+                    prev_fp = thisframe->saved_regs[regno];
+                  else
+                    prev_fp =
+                      read_memory_integer (thisframe->saved_regs[regno],
+                                           S390_GPR_SIZE);
+                }
            }
        }
     }