aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-09-03 15:42:04 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-09-03 15:42:04 +0000
commit14dba4b472beeb95c8018fedc795d9379b36e0a3 (patch)
treea892be119172870b7efb5013cb4490d16f618ad9 /gdb/cli
parentc8cbd2725ad1bb3cf51dc01f5c6e219b749e03f2 (diff)
downloadbinutils-14dba4b472beeb95c8018fedc795d9379b36e0a3.zip
binutils-14dba4b472beeb95c8018fedc795d9379b36e0a3.tar.gz
binutils-14dba4b472beeb95c8018fedc795d9379b36e0a3.tar.bz2
gdb/
* breakpoint.c (save_breakpoints): Use RETURN_MASK_ALL. * cli-out.c: Include vec.h. (cli_field_fmt, cli_spaces, cli_text, cli_message, cli_flush): New variable stream, initialize it, use it. (cli_redirect): New function comment. Replace the stream and original_stream fields by the new streams field. Remove the original_stream != NULL conditional, assert error on NULL instead. (out_field_fmt, field_separator): New variable stream, initialize it, use it. (cli_out_data_ctor): Assert non-NULL stream. Replace the stream and original_stream fields by the new streams field. (cli_out_set_stream): Replace the stream field by the new streams field. * cli-out.h: Include vec.h. (ui_filep): New typedef, call DEF_VEC_P for it. (struct cli_ui_out_data): Replace the stream and original_stream fields by the new streams field. * cli/cli-logging.c (set_logging_redirect): Call ui_out_redirect with NULL first. Extend the comment. (handle_redirections): Call ui_out_redirect with output. * python/py-breakpoint.c (bppy_get_commands): Move ui_out_redirect calls outside of the TRY_CATCH block. gdb/testsuite/ * gdb.base/ui-redirect.exp: New file.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-logging.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index aa53523..fc486d3 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -118,8 +118,13 @@ set_logging_redirect (char *args, int from_tty, struct cmd_list_element *c)
gdb_stdtarg = output;
logging_no_redirect_file = new_logging_no_redirect_file;
- /* It should not happen, the redirection has been already setup. */
- if (ui_out_redirect (uiout, output) < 0)
+ /* There is a former output pushed on the ui_out_redirect stack. We want to
+ replace it by OUTPUT so we must pop the former value first. We should
+ either do both the pop and push or to do neither of it. At least do not
+ try to push OUTPUT if the pop already failed. */
+
+ if (ui_out_redirect (uiout, NULL) < 0
+ || ui_out_redirect (uiout, output) < 0)
warning (_("Current output protocol does not support redirection"));
if (logging_redirect != 0)
@@ -212,7 +217,7 @@ handle_redirections (int from_tty)
gdb_stdlog = output;
gdb_stdtarg = output;
- if (ui_out_redirect (uiout, gdb_stdout) < 0)
+ if (ui_out_redirect (uiout, output) < 0)
warning (_("Current output protocol does not support redirection"));
}