Use scoped_restore for current_ui

This changes most uses of make_cleanup_restore_current_ui to use
scoped_restore.  The use in switch_thru_all_uis_init still remains;
that is dealt with in a later patch by replacing this iterator with a
real class.

2016-10-21  Tom Tromey  <tom@tromey.com>

	* top.c (new_ui_command, wait_sync_command_done)
	(gdb_readline_wrapper): Use scoped_restore.
	* infrun.c (fetch_inferior_event): Use scoped_restore.
	* infcall.c (call_thread_fsm_should_stop): Use scoped_restore.
This commit is contained in:
Tom Tromey
2016-09-22 20:50:52 -06:00
parent 9746809447
commit 4b6749b9a4
4 changed files with 31 additions and 31 deletions

View File

@@ -3903,8 +3903,7 @@ fetch_inferior_event (void *client_data)
/* Events are always processed with the main UI as current UI. This
way, warnings, debug output, etc. are always consistently sent to
the main console. */
make_cleanup_restore_current_ui ();
current_ui = main_ui;
scoped_restore save_ui = make_scoped_restore (&current_ui, main_ui);
/* End up with readline processing input, if necessary. */
make_cleanup (reinstall_readline_callback_handler_cleanup, NULL);