[gdb/testsuite] Don't timeout on prompt in gdb_start_cmd
authorTom de Vries <tdevries@suse.de>
Fri, 11 Nov 2022 14:52:10 +0000 (15:52 +0100)
committerTom de Vries <tdevries@suse.de>
Fri, 11 Nov 2022 14:52:10 +0000 (15:52 +0100)
We're currently running into a timeout at:
...
(gdb) start ^M
Error in expression, near `1'.^M
(gdb) UNTESTED: gdb.ada/start.exp: start failed to land inside the right \
  procedure
...
due to the fact that gdb_start_cmd doesn't handle a prompt as reaction to
the start command.

Fix this by handling the prompt.  Reduces execution time of the test-case from
1m1s to 1s.

Tested on x86_64-linux.

gdb/testsuite/lib/gdb.exp

index d70b6410441f7fd71220594c673ea11e14d0fd3d..1240c2ef6f324e0f994b74d8963feb104173ff90 100644 (file)
@@ -548,6 +548,7 @@ proc gdb_start_cmd { {inferior_args {}} } {
        -notransfer -re "Starting program: \[^\r\n\]*" {
            return 0
        }
+       -re "$gdb_prompt $" { }
     }
     return -1
 }