aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2003-07-23 21:23:54 +0000
committerStephane Carrez <stcarrez@nerim.fr>2003-07-23 21:23:54 +0000
commitbc7386a779f752ffd0124e8e9928e75ba6c9f7be (patch)
tree445eb41e9ad0b5f9e8f330f31c8fca47e1736117
parent11f8b8d624d5b0ff2664b76e465e77926554fd56 (diff)
downloadgdb-bc7386a779f752ffd0124e8e9928e75ba6c9f7be.zip
gdb-bc7386a779f752ffd0124e8e9928e75ba6c9f7be.tar.gz
gdb-bc7386a779f752ffd0124e8e9928e75ba6c9f7be.tar.bz2
* tui-interp.c (tui_resume): Enable tui when we expected it.
(tui_suspend): Remember in which TUI mode we are. (_initialize_tui_interp): Use the tui interpreter even when no other interpreter was set and define in which TUI mode to start.
-rw-r--r--gdb/tui/ChangeLog7
-rw-r--r--gdb/tui/tui-interp.c15
2 files changed, 21 insertions, 1 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index e90e946..28fd932 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,10 @@
+2003-07-23 Stephane Carrez <stcarrez@nerim.fr>
+
+ * tui-interp.c (tui_resume): Enable tui when we expected it.
+ (tui_suspend): Remember in which TUI mode we are.
+ (_initialize_tui_interp): Use the tui interpreter even when no
+ other interpreter was set and define in which TUI mode to start.
+
2003-07-02 Daniel Jacobowitz <drow@mvista.com>
* tui-out.c (tui_ui_out_impl): Add NULL for redirect member.
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index f935ea4..0c1effb 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -31,6 +31,9 @@
#include "tui/tui.h"
#include "tui/tuiIO.h"
+/* Set to 1 when the TUI mode must be activated when we first start gdb. */
+static int tui_start_enabled = 0;
+
/* Cleanup the tui before exiting. */
static void
@@ -61,13 +64,15 @@ static int
tui_resume (void *data)
{
gdb_setup_readline ();
- tui_enable ();
+ if (tui_start_enabled)
+ tui_enable ();
return 1;
}
static int
tui_suspend (void *data)
{
+ tui_start_enabled = tui_active;
tui_disable ();
return 1;
}
@@ -177,4 +182,12 @@ _initialize_tui_interp (void)
/* Create a default uiout builder for the TUI. */
tui_out = tui_out_new (gdb_stdout);
interp_add (interp_new ("tui", NULL, tui_out, &procs));
+ if (interpreter_p && strcmp (interpreter_p, "tui") == 0)
+ tui_start_enabled = 1;
+
+ if (interpreter_p && strcmp (interpreter_p, INTERP_CONSOLE) == 0)
+ {
+ xfree (interpreter_p);
+ interpreter_p = xstrdup ("tui");
+ }
}