summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/gdb/gdb/frame.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/gdb/gdb/frame.c b/contrib/gdb/gdb/frame.c
index a032c47..3650b7c 100644
--- a/contrib/gdb/gdb/frame.c
+++ b/contrib/gdb/gdb/frame.c
@@ -1846,6 +1846,23 @@ get_prev_frame (struct frame_info *this_frame)
return NULL;
}
+ /* Assume that the only way to get a zero PC is through something
+ like a SIGSEGV or a dummy frame, and hence that NORMAL frames
+ will never unwind a zero PC. */
+ if (this_frame->level > 0
+ && get_frame_type (this_frame) == NORMAL_FRAME
+ && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
+ && get_frame_pc (this_frame) == 0)
+ {
+ if (frame_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "-> ");
+ fprint_frame (gdb_stdlog, this_frame->prev);
+ fprintf_unfiltered (gdb_stdlog, " // zero PC \n");
+ }
+ return NULL;
+ }
+
/* Only try to do the unwind once. */
if (this_frame->prev_p)
{
OpenPOWER on IntegriCloud