aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame-unwind.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-11-28 15:48:51 +0000
committerPedro Alves <palves@redhat.com>2013-11-28 17:37:47 +0000
commit50fd528a13ff8a6131ead1b2635fa8a8cf828d80 (patch)
treee09b1b4391e4a0715e53c0edffcfbe421fc18c91 /gdb/frame-unwind.c
parent5de51581685123bedd8160aec9a660e85e7a8b73 (diff)
downloadgdb-50fd528a13ff8a6131ead1b2635fa8a8cf828d80.zip
gdb-50fd528a13ff8a6131ead1b2635fa8a8cf828d80.tar.gz
gdb-50fd528a13ff8a6131ead1b2635fa8a8cf828d80.tar.bz2
get_prev_frame, outer_frame_id and unwind->stop_reason checks are redundant.
After the previous patch, it should be clear that the this_frame->unwind->stop_reason check is redundant with the outer_frame_id check just below. We can now move the frame_id_eq comparison to the default this_frame->unwind->stop_reason callback. Tested on x86_64 Fedora 17. gdb/ 2013-11-28 Pedro Alves <palves@redhat.com> * frame-unwind.c (default_frame_unwind_stop_reason): Return UNWIND_OUTERMOST if the frame's ID is outer_frame_id. * frame.c (get_prev_frame_1): Remove outer_frame_id check.
Diffstat (limited to 'gdb/frame-unwind.c')
-rw-r--r--gdb/frame-unwind.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index a731b33..8fabf52 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -143,14 +143,18 @@ default_frame_sniffer (const struct frame_unwind *self,
return 1;
}
-/* A default frame unwinder stop_reason callback that always claims
- the frame is unwindable. */
+/* The default frame unwinder stop_reason callback. */
enum unwind_stop_reason
default_frame_unwind_stop_reason (struct frame_info *this_frame,
void **this_cache)
{
- return UNWIND_NO_REASON;
+ struct frame_id this_id = get_frame_id (this_frame);
+
+ if (frame_id_eq (this_id, outer_frame_id))
+ return UNWIND_OUTERMOST;
+ else
+ return UNWIND_NO_REASON;
}
/* Helper functions for value-based register unwinding. These return