[RFC] Using values to handle unwinding
Daniel Jacobowitz
drow@false.org
Wed Oct 17 22:09:00 GMT 2007
There is one current use I know of for the NEXT_FRAME argument to
unwinders, in s390-tdep.c:
/* If the next frame is a NORMAL_FRAME, this frame *cannot* have frame
size zero. This is only possible if the next frame is a sentinel
frame, a dummy frame, or a signal trampoline frame. */
/* FIXME: cagney/2004-05-01: This sanity check shouldn't be
needed, instead the code should simpliy rely on its
analysis. */
if (get_frame_type (next_frame) == NORMAL_FRAME)
return 0;
Maybe this means we should either find a generic place to do this sort
of check, or pass both this and next frame, or leave the frame
argument alone after all. Or add a new frame function, like
"frame_called_normally (this_frame)" which seems to be the question
people are really asking when they write code like the above.
I noticed this while looking at m68k-elf backtraces. It would be nice
to add a check like the above, either there or somewhere more generic,
because otherwise a garbage stack pointer leads to a near-infinite
backtrace. Any time that the current frame's PC points to somewhere
GDB has no symbol info, GDB will conclude that there is a frameless
function which only stored its return address on the stack at the
call. So each word of the stack is popped in turn and becomes a new
PC. Not very useful!
--
Daniel Jacobowitz
CodeSourcery
More information about the Gdb
mailing list