* sparc-tdep.c (sparc_get_saved_register): Comment why
authorAndrew Cagney <cagney@redhat.com>
Sun, 5 May 2002 01:55:37 +0000 (01:55 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 5 May 2002 01:55:37 +0000 (01:55 +0000)
get_prev_frame call is safe.

gdb/ChangeLog
gdb/sparc-tdep.c

index c7e3758bb2f8cd14e1e8444052814636bad2238b..214793733a4939b074f591f1e6ea5fbfb02f80b5 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-04  Andrew Cagney  <ac131313@redhat.com>
+
+       * sparc-tdep.c (sparc_get_saved_register): Comment why
+       get_prev_frame call is safe.
+
 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
 
        * frame.h (select_frame): Delete level parameter.
index 28c51dc8c64cc0c6002f96e0864ded02831c6b5a..6461ca088f6c4c04bf4eecfe438772d353b99c07 100644 (file)
@@ -855,10 +855,20 @@ 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)
+           /* NOTE: cagney/2002-05-04: The call to get_prev_frame()
+               is safe/cheap - there will always be a prev frame.
+               This is because frame1 is initialized to frame->next
+               (frame1->prev == frame) and is then advanced towards
+               the innermost (next) frame.  */
            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)
+           /* NOTE: cagney/2002-05-04: The call to get_prev_frame()
+               is safe/cheap - there will always be a prev frame.
+               This is because frame1 is initialized to frame->next
+               (frame1->prev == frame) and is then advanced towards
+               the innermost (next) frame.  */
            addr = (get_prev_frame (frame1)->extra_info->bottom
                    + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
                    + FRAME_SAVED_L0);