From 4b6749b9a4680e79affdb9c02ea2f5ba39a54587 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 22 Sep 2016 20:50:52 -0600 Subject: 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 * 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. --- gdb/infrun.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gdb/infrun.c') diff --git a/gdb/infrun.c b/gdb/infrun.c index 6fc1acf..8d81c97 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -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 (¤t_ui, main_ui); /* End up with readline processing input, if necessary. */ make_cleanup (reinstall_readline_callback_handler_cleanup, NULL); -- cgit v1.1