From ebedcab50d2c7699ced23f4cf4eae712c0a9ca40 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 3 Jan 2011 13:11:06 +0000 Subject: gdb/ * frame.c (get_prev_frame_1) : New variables this_pc_in_block, morestack_msym and morestack_name. Check for "__morestack" minimal symbol there. gdb/testsuite/ * gdb.base/morestack.exp: New file. * gdb.base/morestack.c: New file. --- gdb/frame.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'gdb/frame.c') diff --git a/gdb/frame.c b/gdb/frame.c index e36ba91..87122cd 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1502,14 +1502,26 @@ get_prev_frame_1 (struct frame_info *this_frame) && frame_id_inner (get_frame_arch (this_frame->next), this_id, get_frame_id (this_frame->next))) { - if (frame_debug) + CORE_ADDR this_pc_in_block; + struct minimal_symbol *morestack_msym; + const char *morestack_name = NULL; + + /* gcc -fsplit-stack __morestack can continue the stack anywhere. */ + this_pc_in_block = get_frame_address_in_block (this_frame); + morestack_msym = lookup_minimal_symbol_by_pc (this_pc_in_block); + if (morestack_msym) + morestack_name = SYMBOL_LINKAGE_NAME (morestack_msym); + if (!morestack_name || strcmp (morestack_name, "__morestack") != 0) { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, " // this frame ID is inner }\n"); + if (frame_debug) + { + fprintf_unfiltered (gdb_stdlog, "-> "); + fprint_frame (gdb_stdlog, NULL); + fprintf_unfiltered (gdb_stdlog, " // this frame ID is inner }\n"); + } + this_frame->stop_reason = UNWIND_INNER_ID; + return NULL; } - this_frame->stop_reason = UNWIND_INNER_ID; - return NULL; } /* Check that this and the next frame are not identical. If they -- cgit v1.1