diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-10-18 19:52:05 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-10-18 19:52:05 +0000 |
commit | 55feb68948b4abdd94cd91f2a0e3af51d15f033e (patch) | |
tree | 5ba1b78b2d116511595fe7b06c2e1759055f5691 /gdb/stack.c | |
parent | d3f1a42773f49df6e504ab417882daf0ef9ba026 (diff) | |
download | gdb-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/stack.c')
-rw-r--r-- | gdb/stack.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index 6eb96dc..d58ba31 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -923,6 +923,16 @@ frame_info (char *addr_exp, int from_tty) deprecated_print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout); printf_filtered ("\n"); + if (calling_frame_info == NULL) + { + enum unwind_stop_reason reason; + + reason = get_frame_unwind_stop_reason (fi); + if (reason != UNWIND_NO_REASON) + printf_filtered (_(" Outermost frame: %s\n"), + frame_stop_reason_string (reason)); + } + if (calling_frame_info) { printf_filtered (" called by frame at "); @@ -940,6 +950,7 @@ frame_info (char *addr_exp, int from_tty) } if (get_next_frame (fi) || calling_frame_info) puts_filtered ("\n"); + if (s) printf_filtered (" source language %s.\n", language_str (s->language)); @@ -1163,11 +1174,26 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty) print_frame_info (fi, 1, LOCATION, 1); if (show_locals) print_frame_local_vars (fi, 1, gdb_stdout); + + /* Save the last frame to check for error conditions. */ + trailing = fi; } /* If we've stopped before the end, mention that. */ if (fi && from_tty) printf_filtered (_("(More stack frames follow...)\n")); + + /* If we've run out of frames, and the reason appears to be an error + condition, print it. */ + if (fi == NULL && trailing != NULL) + { + enum unwind_stop_reason reason; + + reason = get_frame_unwind_stop_reason (trailing); + if (reason > UNWIND_FIRST_ERROR) + printf_filtered (_("Backtrace stopped: %s\n"), + frame_stop_reason_string (reason)); + } } struct backtrace_command_args |