diff options
author | Daniel Jacobowitz <dan@debian.org> | 2006-05-10 18:34:29 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2006-05-10 18:34:29 +0000 |
commit | 7c1c5e0c8377375c8267ff24166663c14e507698 (patch) | |
tree | 65ce5665e0fc978b81d5be75fb03122caaed539c | |
parent | 5ec66662eacf1140fab0c4e9990fd85691d44e70 (diff) | |
download | gdb-7c1c5e0c8377375c8267ff24166663c14e507698.tar.gz |
* gdb/frame.c (get_prev_frame): Move check for pc == 0 ...
(get_prev_frame_1): ... to here.
-rw-r--r-- | ChangeLog.csl | 5 | ||||
-rw-r--r-- | gdb/frame.c | 32 |
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); } |