]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.tui/tui-mode-switch.exp on aarch64
authorTom de Vries <tdevries@suse.de>
Mon, 18 Aug 2025 14:17:15 +0000 (16:17 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 18 Aug 2025 14:17:15 +0000 (16:17 +0200)
On aarch64-linux, occasionally I run into these warnings:
...
PASS: gdb.tui/tui-mode-switch.exp: set style enabled off
WARNING: timeout in accept_gdb_output
PASS: gdb.tui/tui-mode-switch.exp: no boo
WARNING: timeout in accept_gdb_output
...

The first in more detail:
...
Box Dump (40 x 1) @ (0, 11):
   11 b(gdb) b
WARNING: timeout in accept_gdb_output
...

Fix this by waiting for a prompt after leaving TUI before sending "b".

Also, while we're at it generate a few more passes.

Tested on aarch64-linux.

gdb/testsuite/gdb.tui/tui-mode-switch.exp

index 827677c39b9a056358339371dbf9cdd5360d90b9..c60596213b859c6bd47267698c99042bade1cfc8 100644 (file)
@@ -30,16 +30,21 @@ for { set i 1 } { $i <= 11 } { incr i } {
 # Type "foo".
 send_gdb "foo"
 set line { 0 11 40 1 }
-Term::wait_for_region_contents {*}$line "^$gdb_prompt foo"
+gdb_assert { [Term::wait_for_region_contents {*}$line "^$gdb_prompt foo"] } \
+    "type foo"
 
 # Enter TUI.
 send_gdb "\030\001"
-Term::wait_for ""
+gdb_assert { [Term::wait_for ""] } "enter TUI"
 
-# Exit TUI, type b.
+# Exit TUI.
 send_gdb "\030\001"
+gdb_assert { [Term::wait_for ""] } "exit TUI"
+
+# Type b.
 send_gdb "b"
-Term::wait_for_region_contents {*}$line "^$gdb_prompt b"
+gdb_assert { [Term::wait_for_region_contents {*}$line "^$gdb_prompt b"] } \
+    "type b"
 
 # Check that we don't see "boo".
 gdb_assert { ![Term::check_region_contents_p {*}$line "^$gdb_prompt boo"] } \