diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-11-19 17:35:46 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-11-19 17:35:46 +0000 |
commit | 3f1d7f16175ed510e7151aecd3c9c92f8d88e175 (patch) | |
tree | 335fcb08f4c872b19c9a1e190d8ac17831a349a5 | |
parent | 667e784fcb11bf5af2900371192cc997a606b18e (diff) | |
download | gdb-3f1d7f16175ed510e7151aecd3c9c92f8d88e175.zip gdb-3f1d7f16175ed510e7151aecd3c9c92f8d88e175.tar.gz gdb-3f1d7f16175ed510e7151aecd3c9c92f8d88e175.tar.bz2 |
* 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.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/frame.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 58001db..067abd9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-11-19 Mark Kettenis <kettenis@gnu.org> + + * 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. + 2003-11-19 Andrew Cagney <cagney@redhat.com> * stack.c (return_command): Handle "void", "legacy" and "unknown diff --git a/gdb/frame.c b/gdb/frame.c index a405a6b..bedbae4 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 |