aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2001-07-21 22:35:40 +0000
committerStephane Carrez <stcarrez@nerim.fr>2001-07-21 22:35:40 +0000
commit9d876a16bb342a6438a0e7627e1f919de85415d7 (patch)
treec074f8410dc5367131ee09df461ae9b89418c05d /gdb/tui
parent5ecb18062a4db32339e1e2288686cc3ecdb5c428 (diff)
downloadgdb-9d876a16bb342a6438a0e7627e1f919de85415d7.zip
gdb-9d876a16bb342a6438a0e7627e1f919de85415d7.tar.gz
gdb-9d876a16bb342a6438a0e7627e1f919de85415d7.tar.bz2
* tuiIO.c (tui_initialize_io): Install tui_cont_sig signal handler
if SIGCONT is defined. (tui_cont_sig): New function when SIGCONT is defined. (tui_setup_io): Save tty setting to restore by SIGCONT.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/ChangeLog7
-rw-r--r--gdb/tui/tuiIO.c29
2 files changed, 36 insertions, 0 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index f00e838..85f317e 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,5 +1,12 @@
2001-07-22 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+ * tuiIO.c (tui_initialize_io): Install tui_cont_sig signal handler
+ if SIGCONT is defined.
+ (tui_cont_sig): New function when SIGCONT is defined.
+ (tui_setup_io): Save tty setting to restore by SIGCONT.
+
+2001-07-22 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
* tui.h (tui_show_assembly): Declare.
(tui_is_window_visible): Declare.
* tui.c (tui_show_assembly): New function.
diff --git a/gdb/tui/tuiIO.c b/gdb/tui/tuiIO.c
index c4d43a6..a089929 100644
--- a/gdb/tui/tuiIO.c
+++ b/gdb/tui/tuiIO.c
@@ -37,6 +37,7 @@
#include "ui-out.h"
#include "cli-out.h"
#include <fcntl.h>
+#include <signal.h>
/* This file controls the IO interactions between gdb and curses.
When the TUI is enabled, gdb has two modes a curses and a standard
@@ -267,6 +268,9 @@ tui_setup_io (int mode)
gdb_stdlog = gdb_stdout; /* for moment */
gdb_stdtarg = gdb_stderr; /* for moment */
uiout = tui_out;
+
+ /* Save tty for SIGCONT. */
+ savetty ();
}
else
{
@@ -284,13 +288,38 @@ tui_setup_io (int mode)
rl_getc_function = tui_old_rl_getc_function;
rl_outstream = tui_old_rl_outstream;
readline_echoing_p = tui_old_readline_echoing_p;
+
+ /* Save tty for SIGCONT. */
+ savetty ();
}
}
+#ifdef SIGCONT
+/* Catch SIGCONT to restore the terminal and refresh the screen. */
+static void
+tui_cont_sig (int sig)
+{
+ if (tui_active)
+ {
+ /* Restore the terminal setting because another process (shell)
+ might have changed it. */
+ resetty ();
+
+ /* Force a refresh of the screen. */
+ tuiRefreshAll ();
+ }
+ signal (sig, tui_cont_sig);
+}
+#endif
+
/* Initialize the IO for gdb in curses mode. */
void
tui_initialize_io ()
{
+#ifdef SIGCONT
+ signal (SIGCONT, tui_cont_sig);
+#endif
+
/* Create tui output streams. */
tui_stdout = tui_fileopen (stdout);
tui_stderr = tui_fileopen (stderr);