diff options
author | Tom Tromey <tom@tromey.com> | 2016-09-24 21:53:54 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-10-21 14:17:36 -0600 |
commit | 67ad9399e2a69757f06886ee61ce7f36d15e768a (patch) | |
tree | 2892071556a11ba6021980c45359b3a97965dee3 /gdb/infrun.c | |
parent | d1e4a624699fd734b3b6e87fb79a4da71c182dfd (diff) | |
download | gdb-67ad9399e2a69757f06886ee61ce7f36d15e768a.zip gdb-67ad9399e2a69757f06886ee61ce7f36d15e768a.tar.gz gdb-67ad9399e2a69757f06886ee61ce7f36d15e768a.tar.bz2 |
Remove make_cleanup_restore_current_uiout
This removes make_cleanup_restore_current_uiout in favor of an
RAII-based class.
2016-10-21 Tom Tromey <tom@tromey.com>
* stack.c (print_stack_frame_to_uiout): Use scoped_restore.
* ui-out.c (make_cleanup_restore_current_uiout)
(restore_current_uiout_cleanup): Remove.
* infrun.c (print_stop_event): Use scoped_restore.
* ui-out.h (make_cleanup_restore_current_uiout): Don't declare.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 3069b2d..00bba16 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -8084,22 +8084,20 @@ print_stop_location (struct target_waitstatus *ws) void print_stop_event (struct ui_out *uiout) { - struct cleanup *old_chain; struct target_waitstatus last; ptid_t last_ptid; struct thread_info *tp; get_last_target_status (&last_ptid, &last); - old_chain = make_cleanup_restore_current_uiout (); - current_uiout = uiout; - - print_stop_location (&last); + { + scoped_restore save_uiout = make_scoped_restore (¤t_uiout, uiout); - /* Display the auto-display expressions. */ - do_displays (); + print_stop_location (&last); - do_cleanups (old_chain); + /* Display the auto-display expressions. */ + do_displays (); + } tp = inferior_thread (); if (tp->thread_fsm != NULL |