[pushed,gdb/testsuite] Don't timeout on prompt in gdb_start_cmd

Message ID 20221111145245.27495-1-tdevries@suse.de
State Committed
Commit ac42aa228f3f1ebda16ddb53b993d6341dbbf100
Headers
Series [pushed,gdb/testsuite] Don't timeout on prompt in gdb_start_cmd |

Commit Message

Tom de Vries Nov. 11, 2022, 2:52 p.m. UTC
  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 | 1 +
 1 file changed, 1 insertion(+)


base-commit: 4f04dba96d4783bae62e7fe4a5eace9fc414723d
  

Patch

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d70b6410441..1240c2ef6f3 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -548,6 +548,7 @@  proc gdb_start_cmd { {inferior_args {}} } {
 	-notransfer -re "Starting program: \[^\r\n\]*" {
 	    return 0
 	}
+	-re "$gdb_prompt $" { }
     }
     return -1
 }