diff options
Diffstat (limited to 'gdb/ui-out.c')
-rw-r--r-- | gdb/ui-out.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 3972a56..ec44ab6 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -953,6 +953,24 @@ ui_out_destroy (struct ui_out *uiout) xfree (uiout); } +/* Cleanup that restores a previous current uiout. */ + +static void +restore_current_uiout_cleanup (void *arg) +{ + struct ui_out *saved_uiout = (struct ui_out *) arg; + + current_uiout = saved_uiout; +} + +/* See ui-out.h. */ + +struct cleanup * +make_cleanup_restore_current_uiout (void) +{ + return make_cleanup (restore_current_uiout_cleanup, current_uiout); +} + /* Standard gdb initialization hook. */ void |