]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
get_prev_frame, UNWIND_NULL_ID -> UNWIND_OUTERMOST
authorPedro Alves <palves@redhat.com>
Thu, 28 Nov 2013 15:44:58 +0000 (15:44 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 28 Nov 2013 17:35:28 +0000 (17:35 +0000)
- The UNWIND_NULL_ID check in get_prev_frame_1 used to really be
  against null_frame_id, back before we had outer_frame_id.  We didn't
  have UNWIND_OUTERMOST when outer_frame_id was added, but we do now,
  and it's more accurate.

- It used to be necessary to check for the sentinel frame explicitly
  because that uses null_frame_id for frame id.  Since no other frame
  can have that id nowadays (it's asserted by compute_frame_id), we
  don't need that explicit check.

Tested on x86_64 Fedora 17.

gdb/
2013-11-28  Pedro Alves  <palves@redhat.com>

* frame.c (get_prev_frame_1): If the frame id is outer_frame_id,
set the unwind stop reason to UNWIND_OUTERMOST, not
UNWIND_NULL_ID.  Remove explicit check for sentinel frame.

gdb/ChangeLog
gdb/frame.c

index 33bd755da5f86c1e81c7aeaec5eaa61398f06abb..2076e5db445aad57d2e19845d9f3697e9b81fcdb 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-28  Pedro Alves  <palves@redhat.com>
+
+       * frame.c (get_prev_frame_1): If the frame id is outer_frame_id,
+       set the unwind stop reason to UNWIND_OUTERMOST, not
+       UNWIND_NULL_ID.  Remove explicit check for sentinel frame.
+
 2013-11-28  Pedro Alves  <palves@redhat.com>
 
        * frame.c (frame_unwind_register): Say the register was "not
index ea06d51bae2bef8e7e6e79583cb7d06dbf4c5f61..32008acc814b1ce3922ae0d0da78038506e14148 100644 (file)
@@ -1773,19 +1773,18 @@ get_prev_frame_1 (struct frame_info *this_frame)
   if (this_frame->stop_reason != UNWIND_NO_REASON)
     return NULL;
 
-  /* Check that this frame's ID was valid.  If it wasn't, don't try to
-     unwind to the prev frame.  Be careful to not apply this test to
-     the sentinel frame.  */
+  /* Check that this frame is not the outermost.  If it is, don't try
+     to unwind to the prev frame.  */
   this_id = get_frame_id (this_frame);
-  if (this_frame->level >= 0 && frame_id_eq (this_id, outer_frame_id))
+  if (frame_id_eq (this_id, outer_frame_id))
     {
       if (frame_debug)
        {
          fprintf_unfiltered (gdb_stdlog, "-> ");
          fprint_frame (gdb_stdlog, NULL);
-         fprintf_unfiltered (gdb_stdlog, " // this ID is NULL }\n");
+         fprintf_unfiltered (gdb_stdlog, " // frame ID is outer_frame_id }\n");
        }
-      this_frame->stop_reason = UNWIND_NULL_ID;
+      this_frame->stop_reason = UNWIND_OUTERMOST;
       return NULL;
     }