]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-11-09 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Sat, 9 Nov 2002 18:14:10 +0000 (18:14 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 9 Nov 2002 18:14:10 +0000 (18:14 +0000)
* frame.c (get_prev_frame): Test prev_p to identify a previously
unwound frame.  Initialize prev_p.
* frame.h (struct frame_info): Add field prev_p.  Expand prev/next
comment.

gdb/ChangeLog
gdb/frame.c
gdb/frame.h

index 2332d14d660cbc1fdd9c0f6e9a528616c39cb319..269a613735ee823b0a0844cded61570283237a14 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-09  Andrew Cagney  <ac131313@redhat.com>
+
+       * frame.c (get_prev_frame): Test prev_p to identify a previously
+       unwound frame.  Initialize prev_p.
+       * frame.h (struct frame_info): Add field prev_p.  Expand prev/next
+       comment.
+
 2002-11-09  Andrew Cagney  <ac131313@redhat.com>
 
        * frame.c (get_prev_frame): Cleanups.  Eliminate redundant tests
index 86315841ba8a2c50c0246fa80e6c55ed55e15022..bfefc77693448cc05c069542573a0c5f30bb0e6f 100644 (file)
@@ -742,13 +742,10 @@ get_prev_frame (struct frame_info *next_frame)
       return current_frame;
     }
 
-  /* If we have the prev one, return it.  */
-  if (next_frame->prev)
-    /* FIXME: cagney/2002-11-09: Rather than relying on ->PREV being
-       non-NULL, there should be a predicate (->prev_p?).  That would
-       stop this function constantly trying to chain beyond the
-       outermost frame.  */
+  /* Only try to do the unwind once.  */
+  if (next_frame->prev_p)
     return next_frame->prev;
+  next_frame->prev_p = 1;
 
   /* On some machines it is possible to call a function without
      setting up a stack frame for it.  On these machines, we
index 8fd924445861e92cd5b7c0bc5fbaf4b5262f5d37..7b4cca7a1a4103b06e958119eab16d51e4691850 100644 (file)
@@ -140,10 +140,11 @@ struct frame_info
     frame_register_unwind_ftype *register_unwind;
     void *register_unwind_cache;
 
-    /* Pointers to the next (down, inner) and previous (up, outer)
-       frame_info's in the frame cache.  */
-    struct frame_info *next; /* down, inner */
-    struct frame_info *prev; /* up, outer */
+    /* Pointers to the next (down, inner, younger) and previous (up,
+       outer, older) frame_info's in the frame cache.  */
+    struct frame_info *next; /* down, inner, younger */
+    int prev_p;
+    struct frame_info *prev; /* up, outer, older */
   };
 
 /* Values for the source flag to be used in print_frame_info_base(). */