This is the mail archive of the
mailing list for the GDB project.
Unwinding through multiple stacks
- From: Doug Evans <dje at google dot com>
- To: Andy Wingo <wingo at igalia dot com>
- Cc: Alexander Smundak <asmundak at google dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 24 Mar 2015 17:00:07 -0700
- Subject: Unwinding through multiple stacks
- Authentication-results: sourceware.org; auth=none
A topic came up on #gdb that the current patches don't cover.
What if the frame we're trying to unwind through has a different stack?
If the different stack is below the "normal" stack gdb will complain:
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
The code to catch this is in frame.c:
/* Check that this frame's ID isn't inner to (younger, below, next)
the next frame. This happens when a frame unwind goes backwards.
This check is valid only if this frame and the next frame are
See the comment at frame_id_inner for details. */
if (get_frame_type (this_frame) == NORMAL_FRAME
&& this_frame->next->unwind->type == NORMAL_FRAME
&& frame_id_inner (get_frame_arch (this_frame->next),
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).minsym;
morestack_name = MSYMBOL_LINKAGE_NAME (morestack_msym);
if (!morestack_name || strcmp (morestack_name, "__morestack") != 0)
fprintf_unfiltered (gdb_stdlog, "-> ");
fprint_frame (gdb_stdlog, NULL);
" // this frame ID is inner }\n");
this_frame->stop_reason = UNWIND_INNER_ID;
We need to generalize the __morestack solution
and provide it through the unwinders.