aboutsummaryrefslogtreecommitdiff
path: root/gdb/terminal.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/terminal.h')
-rw-r--r--gdb/terminal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/terminal.h b/gdb/terminal.h
index 54e5e98..720fd4a 100644
--- a/gdb/terminal.h
+++ b/gdb/terminal.h
@@ -19,6 +19,8 @@
#ifndef GDB_TERMINAL_H
#define GDB_TERMINAL_H
+#include "serial.h"
+
struct inferior;
extern void new_tty_prefork (std::string ttyname);
@@ -43,4 +45,17 @@ extern void gdb_save_tty_state (void);
have had a chance to alter it. */
extern void set_initial_gdb_ttystate (void);
+/* Restore initial tty state. */
+extern void restore_initial_gdb_ttystate (void);
+
+/* An RAII-based object that saves the tty state, and then restores it again
+ when this object is destroyed. */
+class scoped_gdb_ttystate
+{
+public:
+ scoped_gdb_ttystate ();
+ ~scoped_gdb_ttystate ();
+private:
+ serial_ttystate m_ttystate;
+};
#endif /* GDB_TERMINAL_H */