* sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame
authorAndrew Cagney <cagney@redhat.com>
Sat, 20 Apr 2002 03:09:28 +0000 (03:09 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 20 Apr 2002 03:09:28 +0000 (03:09 +0000)
instead of ->prev.
* z8k-tdep.c (z8k_frame_chain): Do not use ->prev.
* s390-tdep.c (s390_frame_chain): Do not use ->prev.
* rs6000-tdep.c (frame_get_saved_regs): Use rs6000_frame_chain()
instead of ->prev.

gdb/ChangeLog
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/sparc-tdep.c
gdb/z8k-tdep.c

index d747c922b8277fa8b7cefb8b349331cdb33fe8a9..2f692abbc748f0c0c922bd878db70ff85ae71242 100644 (file)
@@ -1,3 +1,12 @@
+2002-04-14  Andrew Cagney  <ac131313@redhat.com>
+
+       * sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame
+       instead of ->prev.
+       * z8k-tdep.c (z8k_frame_chain): Do not use ->prev.
+       * s390-tdep.c (s390_frame_chain): Do not use ->prev.
+       * rs6000-tdep.c (frame_get_saved_regs): Use rs6000_frame_chain()
+       instead of ->prev.
+
 2002-04-19  Elena Zannoni  <ezannoni@redhat.com>
 
         Fix PR gdb/471.
index 265ecd6de0e48474e2a8f0a3635abebc8c1de3f4..23130b83d5730666a4f7c0dbd2d2878a78520db8 100644 (file)
@@ -1388,10 +1388,13 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap)
       && fdatap->cr_offset == 0
       && fdatap->vr_offset == 0)
     frame_addr = 0;
-  else if (fi->prev && fi->prev->frame)
-    frame_addr = fi->prev->frame;
   else
-    frame_addr = read_memory_addr (fi->frame, wordsize);
+    /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most
+       address of the current frame.  Things might be easier if the
+       ->frame pointed to the outer-most address of the frame.  In the
+       mean time, the address of the prev frame is used as the base
+       address of this frame.  */
+    frame_addr = FRAME_CHAIN (fi);
 
   /* if != -1, fdatap->saved_fpr is the smallest number of saved_fpr.
      All fpr's from saved_fpr to fp31 are saved.  */
index d888ae3ea95821c88f31f35283dbae817d809db5..c69aca69fa3e92655b61d099936d290cdd71b1fe 100644 (file)
@@ -1009,9 +1009,7 @@ s390_frame_chain (struct frame_info *thisframe)
 {
   CORE_ADDR prev_fp = 0;
 
-  if (thisframe->prev && thisframe->prev->frame)
-    prev_fp = thisframe->prev->frame;
-  else if (generic_find_dummy_frame (thisframe->pc, thisframe->frame))
+  if (generic_find_dummy_frame (thisframe->pc, thisframe->frame))
     return generic_read_register_dummy (thisframe->pc, thisframe->frame,
                                         S390_SP_REGNUM);
   else
index d6c5dcceace988b1e220614ee59f7bb71e6d98ff..88aeb67e153ddcece7946a566d6b183b117ce011 100644 (file)
@@ -829,11 +829,11 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
            addr = frame1->frame + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
              - (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE);
          else if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
-           addr = (frame1->prev->extra_info->bottom
+           addr = (get_prev_frame (frame1)->extra_info->bottom
                    + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
                    + FRAME_SAVED_I0);
          else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
-           addr = (frame1->prev->extra_info->bottom
+           addr = (get_prev_frame (frame1)->extra_info->bottom
                    + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
                    + FRAME_SAVED_L0);
          else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
@@ -875,11 +875,11 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
        {
          /* Normal frame.  Local and In registers are saved on stack.  */
          if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
-           addr = (frame1->prev->extra_info->bottom
+           addr = (get_prev_frame (frame1)->extra_info->bottom
                    + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
                    + FRAME_SAVED_I0);
          else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
-           addr = (frame1->prev->extra_info->bottom
+           addr = (get_prev_frame (frame1)->extra_info->bottom
                    + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
                    + FRAME_SAVED_L0);
          else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
index fa043a2ec1d763aa3a9696e2e30b8d678f365926..572a878dc203cbc917f6fff650c99a983cf51435 100644 (file)
@@ -160,10 +160,6 @@ read_memory_pointer (CORE_ADDR x)
 CORE_ADDR
 z8k_frame_chain (struct frame_info *thisframe)
 {
-  if (thisframe->prev == 0)
-    {
-      /* This is the top of the stack, let's get the sp for real */
-    }
   if (!inside_entry_file (thisframe->pc))
     {
       return read_memory_pointer (thisframe->frame);