summaryrefslogtreecommitdiff
path: root/gdb/ui-out.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ui-out.h')
-rw-r--r--gdb/ui-out.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index d9838379b4b..9ed2bd29531 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -242,4 +242,27 @@ private:
struct ui_out *m_uiout;
};
+/* On destruction, pop the last redirection by calling the uiout's
+ redirect method with a NULL parameter. */
+class ui_out_redirect_pop
+{
+public:
+
+ ui_out_redirect_pop (ui_out *uiout)
+ : m_uiout (uiout)
+ {
+ }
+
+ ~ui_out_redirect_pop ()
+ {
+ m_uiout->redirect (NULL);
+ }
+
+ ui_out_redirect_pop (const ui_out_redirect_pop &) = delete;
+ ui_out_redirect_pop &operator= (const ui_out_redirect_pop &) = delete;
+
+private:
+ struct ui_out *m_uiout;
+};
+
#endif /* UI_OUT_H */