aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/tui-window.exp8
-rw-r--r--gdb/testsuite/gdb.python/tui-window.py11
2 files changed, 19 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/tui-window.exp b/gdb/testsuite/gdb.python/tui-window.exp
index e7ff162..c521dcc 100644
--- a/gdb/testsuite/gdb.python/tui-window.exp
+++ b/gdb/testsuite/gdb.python/tui-window.exp
@@ -43,6 +43,9 @@ if {![Term::enter_tui]} {
return
}
+Term::command "python print('tui_enabled=' + str(tui_enabled))"
+Term::check_contents "tui start event" "tui_enabled=True"
+
Term::command "layout test"
Term::check_contents "test title" \
"This Is The Title"
@@ -63,3 +66,8 @@ Term::resize 51 51
Term::check_contents "Window was updated" "Test: 2"
Term::command "layout fail"
+
+Term::command "tui disable"
+gdb_test "python print('tui_enabled=' + str(tui_enabled))" \
+ "tui_enabled=False" \
+ "tui disable event"
diff --git a/gdb/testsuite/gdb.python/tui-window.py b/gdb/testsuite/gdb.python/tui-window.py
index d031f72..0661acc 100644
--- a/gdb/testsuite/gdb.python/tui-window.py
+++ b/gdb/testsuite/gdb.python/tui-window.py
@@ -20,6 +20,9 @@ import gdb
the_window = None
+tui_enabled = False
+
+
class TestWindow:
def __init__(self, win):
global the_window
@@ -62,3 +65,11 @@ def change_window_title():
gdb.register_window_type("fail", failwin)
+
+
+def set_tui_enabled(ev):
+ global tui_enabled
+ tui_enabled = ev.enabled
+
+
+gdb.events.tui_enabled.connect(set_tui_enabled)