aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2006-09-12 04:00:29 +0000
committerNick Roberts <nickrob@snap.net.nz>2006-09-12 04:00:29 +0000
commit3eac21af31c58495c39dad6a9d0c275b5e28b607 (patch)
tree6cba4bc8d99c5048001c99b43e1f7cf390195e76
parentde3c0fa859a8ef4f0e3635231719d9fd4e7bf738 (diff)
downloadfsf-binutils-gdb-3eac21af31c58495c39dad6a9d0c275b5e28b607.zip
fsf-binutils-gdb-3eac21af31c58495c39dad6a9d0c275b5e28b607.tar.gz
fsf-binutils-gdb-3eac21af31c58495c39dad6a9d0c275b5e28b607.tar.bz2
(cli_interpreter_exec): Revert to version in
mainline but return exception_none.
-rw-r--r--gdb/cli/cli-interp.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index ebe0278..79603c7 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -97,24 +97,22 @@ cli_interpreter_display_prompt_p (void *data)
static struct gdb_exception
cli_interpreter_exec (void *data, const char *command_str)
{
- struct gdb_exception result;
+ struct ui_file *old_stream;
/* FIXME: cagney/2003-02-01: Need to const char *propogate
safe_execute_command. */
char *str = strcpy (alloca (strlen (command_str) + 1), command_str);
- /* We don't need old_stream because we actually change the
- interpreters when we do interpreter exec, then swap them back.
- This code assumes that the interpreter is still the one that is
- exec'ing in the cli interpreter, and we are just faking it up. */
- /* We want
- the person who set the interpreter to get the uiout right for that
- according to their lights. If you don't do that, then you can't share
- the cli_interpreter_exec between the console-unquoted & console
- interpreters. */
- result = safe_execute_command (uiout, str, 1);
-
- return result;
+ /* gdb_stdout could change between the time cli_uiout was initialized
+ and now. Since we're probably using a different interpreter which has
+ a new ui_file for gdb_stdout, use that one instead of the default.
+
+ It is important that it gets reset everytime, since the user could
+ set gdb to use a different interpreter. */
+ old_stream = cli_out_set_stream (cli_uiout, gdb_stdout);
+ safe_execute_command (cli_uiout, str, 1);
+ cli_out_set_stream (cli_uiout, old_stream);
+ return exception_none;
}
static void