2011-08-04 Pedro Alves <pedro@codesourcery.com>

* 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.
This commit is contained in:
Pedro Alves
2011-08-04 18:19:27 +00:00
parent a1e28cb2af
commit f9679975a3
4 changed files with 63 additions and 16 deletions

View File

@@ -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);