summaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-10-18 19:52:05 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-10-18 19:52:05 +0000
commit69dde4e36b0ea95899e89e4bcf1bf27e982199fd (patch)
tree00f7a6f22f049d5ab09a87abcd8f172b4d4abcec /gdb/stack.c
parent1645051101ca0a6fffaa917c841f2c7c54c9793e (diff)
downloadgdb-69dde4e36b0ea95899e89e4bcf1bf27e982199fd.tar.gz
* 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.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 6eb96dc17c2..d58ba31cfec 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