[4/8,gdb/testsuite] Fix timeout in gdb.tui/main.exp

Message ID 20230413140827.19412-5-tdevries@suse.de
State Committed
Headers
Series Fix timeouts in TUI tests |

Commit Message

Tom de Vries April 13, 2023, 2:08 p.m. UTC
  With test-case gdb.tui/main.exp we run into:
...
WARNING: timeout in accept_gdb_output
PASS: gdb.tui/main.exp: show main after file
...

The problem is that this command:
...
Term::command "file [standard_output_file $testfile]"
...
tries to match "(gdb) $cmd", but due to the long file name, $cmd is split up
over two lines:
...
   16 (gdb) file /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.tui/main/ma
   17 in
   18 Reading symbols from /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.t
   19 ui/main/main...
   20 (gdb)
...

Fix this by matching "Reading symbols from" instead.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.tui/main.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/testsuite/gdb.tui/main.exp b/gdb/testsuite/gdb.tui/main.exp
index e5f26c7aac3..a7cacf0a8b8 100644
--- a/gdb/testsuite/gdb.tui/main.exp
+++ b/gdb/testsuite/gdb.tui/main.exp
@@ -34,7 +34,8 @@  if {![Term::enter_tui]} {
     return
 }
 
-Term::command "file [standard_output_file $testfile]"
+send_gdb "file [standard_output_file $testfile]\n"
+gdb_assert { [Term::wait_for "Reading symbols from"] } "file command"
 Term::check_contents "show main after file" "\\|.*21 *return 0"
 
 # Ensure that "file" clears the source window.