summaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-11-19 17:35:46 +0000
committerMark Kettenis <kettenis@gnu.org>2003-11-19 17:35:46 +0000
commit5b560f8f18b5fec5ac09a3fd30a8fd622c9e7b5b (patch)
treeca59e96e8b734c3734dc64dc39a8aba87ea7627a /gdb/frame.c
parent2923da61c6d92ada2a09c553bc004ea0ef13e79a (diff)
downloadgdb-5b560f8f18b5fec5ac09a3fd30a8fd622c9e7b5b.tar.gz
* frame.c (get_prev_frame): Use result from
get_frame_address_in_block instead of get_frame_pc as argument to inside_main_func. Fixes PR backtrace/1435.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index a405a6b736b..bedbae45003 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1790,9 +1790,13 @@ get_prev_frame (struct frame_info *this_frame)
get_current_frame(). */
gdb_assert (this_frame != NULL);
+ /* Make sure we pass an address within THIS_FRAME's code block to
+ inside_main_func. Otherwise, we might stop unwinding at a
+ function which has a call instruction as its last instruction if
+ that function immediately precedes main(). */
if (this_frame->level >= 0
&& !backtrace_past_main
- && inside_main_func (get_frame_pc (this_frame)))
+ && inside_main_func (get_frame_address_in_block (this_frame)))
/* Don't unwind past main(), bug always unwind the sentinel frame.
Note, this is done _before_ the frame has been marked as
previously unwound. That way if the user later decides to