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.
This commit is contained in:
Jan Kratochvil
2010-09-11 16:00:27 +00:00
parent 84f49b315b
commit 8d4d924b76
9 changed files with 75 additions and 1 deletions

View File

@@ -311,6 +311,26 @@ make_cleanup_ui_file_delete (struct ui_file *arg)
return make_my_cleanup (&cleanup_chain, do_ui_file_delete, arg);
}
/* Helper function for make_cleanup_ui_out_redirect_pop. */
static void
do_ui_out_redirect_pop (void *arg)
{
struct ui_out *uiout = arg;
if (ui_out_redirect (uiout, NULL) < 0)
warning (_("Cannot restore redirection of the current output protocol"));
}
/* Return a new cleanup that pops the last redirection by ui_out_redirect
with NULL parameter. */
struct cleanup *
make_cleanup_ui_out_redirect_pop (struct ui_out *uiout)
{
return make_my_cleanup (&cleanup_chain, do_ui_out_redirect_pop, uiout);
}
static void
do_free_section_addr_info (void *arg)
{