From f9679975a3374a650ce5ffc8a512b85d662bfcbf Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 4 Aug 2011 18:19:27 +0000 Subject: 2011-08-04 Pedro Alves * exceptions.c (struct catcher): Remove saved_uiout field. (exceptions_state_mc_init): Remove the `func_uiout' parameter, and no longer save/resvore the global ui_out builder. (catch_exceptions_with_msg): Save/override/restore the global ui_out builder manually instead of relying on TRY_CATCH to do it. (catch_errors): Save/restore the global ui_out builder manually instead of relying on TRY_CATCH to do it. * exceptions.h (exceptions_state_mc_init): Remove the `func_uiout' parameter. (TRY_CATCH): Adjust. * cli/cli-interp.c (safe_execute_command): Save/override/restore the global ui_out builder manually instead of relying on TRY_CATCH to do it. --- gdb/cli/cli-interp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gdb/cli') diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index 88a570c..32883cf 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -112,14 +112,23 @@ cli_interpreter_exec (void *data, const char *command_str) } static struct gdb_exception -safe_execute_command (struct ui_out *uiout, char *command, int from_tty) +safe_execute_command (struct ui_out *command_uiout, char *command, int from_tty) { volatile struct gdb_exception e; + struct ui_out *saved_uiout; + + /* Save and override the global ``struct ui_out'' builder. */ + saved_uiout = uiout; + uiout = command_uiout; TRY_CATCH (e, RETURN_MASK_ALL) { execute_command (command, from_tty); } + + /* Restore the global builder. */ + uiout = saved_uiout; + /* FIXME: cagney/2005-01-13: This shouldn't be needed. Instead the caller should print the exception. */ exception_print (gdb_stderr, e); -- cgit v1.1