aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-10-18 19:52:05 +0000
committerDaniel Jacobowitz <drow@false.org>2006-10-18 19:52:05 +0000
commit55feb68948b4abdd94cd91f2a0e3af51d15f033e (patch)
tree5ba1b78b2d116511595fe7b06c2e1759055f5691 /gdb/frame.h
parentd3f1a42773f49df6e504ab417882daf0ef9ba026 (diff)
downloadgdb-55feb68948b4abdd94cd91f2a0e3af51d15f033e.zip
gdb-55feb68948b4abdd94cd91f2a0e3af51d15f033e.tar.gz
gdb-55feb68948b4abdd94cd91f2a0e3af51d15f033e.tar.bz2
* frame.c (struct frame_info): Add stop_reason.
(get_prev_frame_1): Set stop_reason. Don't call error for stop reasons. (get_frame_unwind_stop_reason, frame_stop_reason_string): New. * frame.h (enum unwind_stop_reason): New. (get_frame_unwind_stop_reason, frame_stop_reason_string): New prototypes. * stack.c (frame_info): Print the stop reason. (backtrace_command_1): Print the stop reason for errors.
Diffstat (limited to 'gdb/frame.h')
-rw-r--r--gdb/frame.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/gdb/frame.h b/gdb/frame.h
index 800cbfb..1d6ae9d 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -394,6 +394,50 @@ enum frame_type
};
extern enum frame_type get_frame_type (struct frame_info *);
+/* For frames where we can not unwind further, describe why. */
+
+enum unwind_stop_reason
+ {
+ /* No particular reason; either we haven't tried unwinding yet,
+ or we didn't fail. */
+ UNWIND_NO_REASON,
+
+ /* The previous frame's analyzer returns an invalid result
+ from this_id.
+
+ FIXME drow/2006-08-16: This is how GDB used to indicate end of
+ stack. We should migrate to a model where frames always have a
+ valid ID, and this becomes not just an error but an internal
+ error. But that's a project for another day. */
+ UNWIND_NULL_ID,
+
+ /* All the conditions after this point are considered errors;
+ abnormal stack termination. If a backtrace stops for one
+ of these reasons, we'll let the user know. This marker
+ is not a valid stop reason. */
+ UNWIND_FIRST_ERROR,
+
+ /* This frame ID looks like it ought to belong to a NEXT frame,
+ but we got it for a PREV frame. Normally, this is a sign of
+ unwinder failure. It could also indicate stack corruption. */
+ UNWIND_INNER_ID,
+
+ /* This frame has the same ID as the previous one. That means
+ that unwinding further would almost certainly give us another
+ frame with exactly the same ID, so break the chain. Normally,
+ this is a sign of unwinder failure. It could also indicate
+ stack corruption. */
+ UNWIND_SAME_ID,
+ };
+
+/* Return the reason why we can't unwind past this frame. */
+
+enum unwind_stop_reason get_frame_unwind_stop_reason (struct frame_info *);
+
+/* Translate a reason code to an informative string. */
+
+const char *frame_stop_reason_string (enum unwind_stop_reason);
+
/* Unwind the stack frame so that the value of REGNUM, in the previous
(up, older) frame is returned. If VALUEP is NULL, don't
fetch/compute the value. Instead just return the location of the