aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-08-04 18:19:27 +0000
committerPedro Alves <palves@redhat.com>2011-08-04 18:19:27 +0000
commitf9679975a3374a650ce5ffc8a512b85d662bfcbf (patch)
treedcae2ee7ee8e1f89c9f3ee86d72978e328ddef8e /gdb/cli
parenta1e28cb2af1ec61d0dea8c9280e52e7153df2df8 (diff)
downloadgdb-f9679975a3374a650ce5ffc8a512b85d662bfcbf.zip
gdb-f9679975a3374a650ce5ffc8a512b85d662bfcbf.tar.gz
gdb-f9679975a3374a650ce5ffc8a512b85d662bfcbf.tar.bz2
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.
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);