aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-interp.c11
1 files changed, 10 insertions, 1 deletions
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);