summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-05-10 18:34:29 +0000
committerDaniel Jacobowitz <drow@false.org>2006-05-10 18:34:29 +0000
commit38ef4f233f7c97ab49ff2127177d3824d3823a22 (patch)
treeca372b0c8d9283f222dae1a85815dc48e1e7acb6
parent4923699afb03ad6fef9a06b5aac99b8cc7fe9a18 (diff)
downloadbinutils-gdb-38ef4f233f7c97ab49ff2127177d3824d3823a22.tar.gz
* gdb/frame.c (get_prev_frame): Move check for pc == 0 ...
(get_prev_frame_1): ... to here.
-rw-r--r--ChangeLog.csl5
-rw-r--r--gdb/frame.c32
2 files changed, 25 insertions, 12 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 04f61f2f11a..5cf4205ac0d 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,8 @@
+2006-05-10 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb/frame.c (get_prev_frame): Move check for pc == 0 ...
+ (get_prev_frame_1): ... to here.
+
2006-05-09 Daniel Jacobowitz <dan@codesourcery.com>
* gdb/bsd-uthread.c (bsd_uthread_solib_loaded): Always pass 0 for
diff --git a/gdb/frame.c b/gdb/frame.c
index 80814fbf35e..0f737741ce5 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1133,6 +1133,26 @@ get_prev_frame_1 (struct frame_info *this_frame)
this_frame->prev = prev_frame;
prev_frame->next = this_frame;
+ /* Now that the frame chain is in a consistant state, check whether
+ this frame is useful. If it is not, unlink it. Its storage will
+ be reclaimed the next time the frame cache is flushed, and we
+ will not try to unwind THIS_FRAME again. */
+
+ /* 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. This will look up the unwinder
+ for the newly created frame, to determine its type. */
+ if (prev_frame->level > 0
+ && get_frame_type (prev_frame) == NORMAL_FRAME
+ && get_frame_type (this_frame) == NORMAL_FRAME
+ && get_frame_pc (prev_frame) == 0)
+ {
+ if (frame_debug)
+ fprintf_unfiltered (gdb_stdlog, "-> // zero PC}\n");
+ this_frame->prev = NULL;
+ return NULL;
+ }
+
if (frame_debug)
{
fprintf_unfiltered (gdb_stdlog, "-> ");
@@ -1310,18 +1330,6 @@ 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)
- {
- frame_debug_got_null_frame (gdb_stdlog, this_frame, "zero PC");
- return NULL;
- }
-
return get_prev_frame_1 (this_frame);
}