[pushed 2/2] [gdb/testsuite] Add missing wait in gdb.python/tui-window-disabled.exp

Tom de Vries tdevries@suse.de
Wed Jun 7 09:38:08 GMT 2023


While working on PR tui/30526, I noticed a bug in test-case
gdb.python/tui-window-disabled.exp.

Here we send "tui enable" to gdb, but don't wait for it to arrive before
checking for a window box:
...
    send_gdb "tui enable\n"
    Term::check_box "check for python window" 0 0 80 16
...

Fix this by waiting for the prompt to be issued in TUI before doing the check.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.python/tui-window-disabled.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/testsuite/gdb.python/tui-window-disabled.exp b/gdb/testsuite/gdb.python/tui-window-disabled.exp
index bee58a86caa..fc69b2b16c2 100644
--- a/gdb/testsuite/gdb.python/tui-window-disabled.exp
+++ b/gdb/testsuite/gdb.python/tui-window-disabled.exp
@@ -186,7 +186,10 @@ proc run_test { cleanup_properly } {
 
     Term::command "layout test"
     Term::command "tui disable"
+
     send_gdb "tui enable\n"
+    gdb_assert { [Term::wait_for "^$::gdb_prompt tui disable"] } "TUI renabled"
+
     Term::check_box "check for python window" 0 0 80 16
 }
 
-- 
2.35.3



More information about the Gdb-patches mailing list