diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2004-11-05 20:32:04 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2004-11-05 20:32:04 +0000 |
commit | d75e3c94b3e236ab6aadcad497264f32b48c921e (patch) | |
tree | ae41749e48fd6dd60a8caa409f089fc44caafc96 /gdb/stack.c | |
parent | 98f276a08832a7fb1ee2707a6e4a3e44d1d4b349 (diff) | |
download | gdb-d75e3c94b3e236ab6aadcad497264f32b48c921e.zip gdb-d75e3c94b3e236ab6aadcad497264f32b48c921e.tar.gz gdb-d75e3c94b3e236ab6aadcad497264f32b48c921e.tar.bz2 |
2004-11-05 Jeff Johnston <jjohnstn@redhat.com>
* defs.h (fatal, vfatal): New function prototypes.
* stack.c (backtrace_command_stub): Stub to call backtrace_command_1
via catch_errors.
(backtrace_command): Change to call backtrace_command_stub via
catch_errors instead of calling backtrace_command_1 directly.
(backtrace_full_command): Ditto.
* utils.c (error_stream_1): New static function.
(verror): Change to call error_stream_1 instead of error_stream.
(error_stream): Call error_stream_1 with RETURN_ERROR argument.
(vfatal, fatal): New functions.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r-- | gdb/stack.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index a04d848..c7cded0 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1218,6 +1218,22 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty) printf_filtered ("(More stack frames follow...)\n"); } +struct backtrace_command_args + { + char *count_exp; + int show_locals; + int from_tty; + }; + +/* Stub to call backtrace_command_1 by way of an error catcher. */ +static int +backtrace_command_stub (void *data) +{ + struct backtrace_command_args *args = (struct backtrace_command_args *)data; + backtrace_command_1 (args->count_exp, args->show_locals, args->from_tty); + return 0; +} + static void backtrace_command (char *arg, int from_tty) { @@ -1225,6 +1241,7 @@ backtrace_command (char *arg, int from_tty) char **argv = (char **) NULL; int argIndicatingFullTrace = (-1), totArgLen = 0, argc = 0; char *argPtr = arg; + struct backtrace_command_args btargs; if (arg != (char *) NULL) { @@ -1274,7 +1291,10 @@ backtrace_command (char *arg, int from_tty) } } - backtrace_command_1 (argPtr, (argIndicatingFullTrace >= 0), from_tty); + btargs.count_exp = argPtr; + btargs.show_locals = (argIndicatingFullTrace >= 0); + btargs.from_tty = from_tty; + catch_errors (backtrace_command_stub, (char *)&btargs, "", RETURN_MASK_ERROR); if (argIndicatingFullTrace >= 0 && totArgLen > 0) xfree (argPtr); @@ -1287,7 +1307,11 @@ static void backtrace_full_command (char *arg, int from_tty); static void backtrace_full_command (char *arg, int from_tty) { - backtrace_command_1 (arg, 1, from_tty); + struct backtrace_command_args btargs; + btargs.count_exp = arg; + btargs.show_locals = 1; + btargs.from_tty = from_tty; + catch_errors (backtrace_command_stub, (char *)&btargs, "", RETURN_MASK_ERROR); } |