From 8a076db965ba49f891b959752db7c8bb0c524688 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 14 Jan 2005 18:55:33 +0000 Subject: 2005-01-13 Andrew Cagney * mi/mi-main.c (mi_execute_command): Print the exception. * cli/cli-interp.c (safe_execute_command): Print the exception. * exceptions.h (exception_print): Declare. * exceptions.c (struct catcher): Add field print_message. (catcher_init): Add parameter print_message, store in the catcher struct. (print_and_throw): Only print the message when print_message. (catch_exceptions_with_msg, catch_errors): Pass print_message=1 to catcher_init. (catch_exception): Pass print_message=0 to catcher_init. --- gdb/cli/cli-interp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gdb/cli/cli-interp.c') diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index cb447e3..ac905b2 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -125,11 +125,16 @@ do_captured_execute_command (struct ui_out *uiout, void *data) static struct exception safe_execute_command (struct ui_out *uiout, char *command, int from_tty) { + struct exception e; struct captured_execute_command_args args; args.command = command; args.from_tty = from_tty; - return catch_exception (uiout, do_captured_execute_command, &args, - RETURN_MASK_ALL); + e = catch_exception (uiout, do_captured_execute_command, &args, + RETURN_MASK_ALL); + /* FIXME: cagney/2005-01-13: This shouldn't be needed. Instead the + caller should print the exception. */ + exception_print (gdb_stderr, NULL, e); + return e; } -- cgit v1.1