summaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-09-24 21:53:54 -0600
committerTom Tromey <tom@tromey.com>2016-10-21 14:17:36 -0600
commit67ad9399e2a69757f06886ee61ce7f36d15e768a (patch)
tree2892071556a11ba6021980c45359b3a97965dee3 /gdb/stack.c
parentd1e4a624699fd734b3b6e87fb79a4da71c182dfd (diff)
downloadbinutils-gdb-67ad9399e2a69757f06886ee61ce7f36d15e768a.tar.gz
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/stack.c')
-rw-r--r--gdb/stack.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 706dd51f58c..823433d913c 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -149,15 +149,9 @@ print_stack_frame_to_uiout (struct ui_out *uiout, struct frame_info *frame,
int print_level, enum print_what print_what,
int set_current_sal)
{
- struct cleanup *old_chain;
-
- old_chain = make_cleanup_restore_current_uiout ();
-
- current_uiout = uiout;
+ scoped_restore save_uiout = make_scoped_restore (&current_uiout, uiout);
print_stack_frame (frame, print_level, print_what, set_current_sal);
-
- do_cleanups (old_chain);
}
/* Show or print a stack frame FRAME briefly. The output is formatted