aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-09-11 16:00:27 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-09-11 16:00:27 +0000
commit8d4d924b76392dfd191e5bc0e54381befb9af0af (patch)
tree145c81b97f6ffe3485a2641514e10ec4eab38b68 /gdb/cli
parent84f49b315b57025e0400e2b5d66b49bef3e16e23 (diff)
downloadgdb-8d4d924b76392dfd191e5bc0e54381befb9af0af.zip
gdb-8d4d924b76392dfd191e5bc0e54381befb9af0af.tar.gz
gdb-8d4d924b76392dfd191e5bc0e54381befb9af0af.tar.bz2
gdb/
Redirect also uiout and stdtarg{,err} in execute_command_to_string. * cli-logging.c (struct saved_output_files) <targerr>: New. (set_logging_redirect, pop_output_files, handle_redirections): Redirect also gdb_stdtargerr. * defs.h (struct ui_out, make_cleanup_ui_out_redirect_pop): New declarations. * event-top.c (gdb_setup_readline, gdb_disable_readline): Redirect also gdb_stdtargerr. * top.c (execute_command_to_string): Move make_cleanup_ui_file_delete to the top. Redirect also gdb_stdlog, gdb_stdtarg and gdb_stdtargerr. Use ui_out_redirect, register make_cleanup_ui_out_redirect_pop. * tui/tui-io.c (tui_setup_io): Redirect also gdb_stdtargerr. * utils.c (do_ui_out_redirect_pop, make_cleanup_ui_out_redirect_pop): New functions. gdb/testsuite/ * gdb.python/python.exp (set height 0, collect help from uiout) (verify help to uiout): New tests.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-logging.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index fc486d3..2640c28 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -33,6 +33,7 @@ struct saved_output_files
struct ui_file *err;
struct ui_file *log;
struct ui_file *targ;
+ struct ui_file *targerr;
};
static struct saved_output_files saved_output;
static char *saved_filename;
@@ -116,6 +117,7 @@ set_logging_redirect (char *args, int from_tty, struct cmd_list_element *c)
gdb_stderr = output;
gdb_stdlog = output;
gdb_stdtarg = output;
+ gdb_stdtargerr = output;
logging_no_redirect_file = new_logging_no_redirect_file;
/* There is a former output pushed on the ui_out_redirect stack. We want to
@@ -154,10 +156,12 @@ pop_output_files (void)
gdb_stderr = saved_output.err;
gdb_stdlog = saved_output.log;
gdb_stdtarg = saved_output.targ;
+ gdb_stdtargerr = saved_output.targ;
saved_output.out = NULL;
saved_output.err = NULL;
saved_output.log = NULL;
saved_output.targ = NULL;
+ saved_output.targerr = NULL;
ui_out_redirect (uiout, NULL);
}
@@ -211,11 +215,13 @@ handle_redirections (int from_tty)
saved_output.err = gdb_stderr;
saved_output.log = gdb_stdlog;
saved_output.targ = gdb_stdtarg;
+ saved_output.targerr = gdb_stdtargerr;
gdb_stdout = output;
gdb_stderr = output;
gdb_stdlog = output;
gdb_stdtarg = output;
+ gdb_stdtargerr = output;
if (ui_out_redirect (uiout, output) < 0)
warning (_("Current output protocol does not support redirection"));