This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Allow backward signal trampoline stacks
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 02 Apr 2004 15:23:21 -0500
- Subject: [commit] Allow backward signal trampoline stacks
Hello,
As demonstrated by my recent sigaltstack testcase, its possible to
construct a stack, that involves signal trampolines, that appears to go
backwards. This patch updates the unwind sanity checks so that GDB
allows such a transition.
committed,
Andrew
2004-04-02 Andrew Cagney <cagney@redhat.com>
* frame.c (get_prev_frame_1): Exclude signal trampolines from the
"previous frame inner to this frame" test.
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.168
diff -u -r1.168 frame.c
--- frame.c 2 Apr 2004 19:44:25 -0000 1.168
+++ frame.c 2 Apr 2004 20:20:12 -0000
@@ -1792,9 +1792,10 @@
/* Check that this frame's ID isn't inner to (younger, below, next)
the next frame. This happens when a frame unwind goes backwards.
- Since the sentinel frame doesn't really exist, don't compare the
- inner-most against that sentinel. */
- if (this_frame->level > 0
+ Exclude signal trampolines (due to sigaltstack the frame ID can
+ go backwards) and sentinel frames (the test is meaningless). */
+ if (this_frame->next->level >= 0
+ && this_frame->next->type != SIGTRAMP_FRAME
&& frame_id_inner (get_frame_id (this_frame),
get_frame_id (this_frame->next)))
error ("Previous frame inner to this frame (corrupt stack?)");