Fix racy output matching in gdb.base/multi-attach.exp, gdb.server/ext-{attach, restar...
authorPedro Alves <palves@redhat.com>
Thu, 9 Nov 2017 22:44:09 +0000 (22:44 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 9 Nov 2017 22:46:44 +0000 (22:46 +0000)
This commit fixes this same problem in several places:

  (gdb) PASS: gdb.multi/multi-attach.exp: backtrace 2
  kill
  Kill the program being debugged? (y or n) y
  (gdb) FAIL: gdb.multi/multi-attach.exp: kill inferior 2 (got interactive prompt)

This is just another case of the gdb_test_multiple's internal "got
interactive prompt" pattern matching because the testcase misses
matching enough.

gdb/testsuite/ChangeLog:
2017-11-09  Pedro Alves  <palves@redhat.com>

* gdb.multi/multi-attach.exp ("kill" test): Match the whole query
output.
* gdb.server/ext-attach.exp ("kill" test): Likewise.
* gdb.server/ext-restart.exp ("kill" test): Likewise.
* gdb.server/ext-run.exp ("kill" test): Likewise.
* gdb.server/ext-wrapper.exp ("kill" test): Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.multi/multi-attach.exp
gdb/testsuite/gdb.server/ext-attach.exp
gdb/testsuite/gdb.server/ext-restart.exp
gdb/testsuite/gdb.server/ext-run.exp
gdb/testsuite/gdb.server/ext-wrapper.exp

index c6c5260dd06bf62120b80061db16695712016ee1..967ef89b6642cff1b896d87965e89d0a55a663c5 100644 (file)
@@ -1,3 +1,12 @@
+2017-11-09  Pedro Alves  <palves@redhat.com>
+
+       * gdb.multi/multi-attach.exp ("kill" test): Match the whole query
+       output.
+       * gdb.server/ext-attach.exp ("kill" test): Likewise.
+       * gdb.server/ext-restart.exp ("kill" test): Likewise.
+       * gdb.server/ext-run.exp ("kill" test): Likewise.
+       * gdb.server/ext-wrapper.exp ("kill" test): Likewise.
+
 2017-11-09  Pedro Alves  <palves@redhat.com>
 
        * gdb.cp/cpcompletion.exp (test_class_complete): Tighten regex to
index 4240ff71a0a3652db1a13ed114c082bc2353c120..9397f8529728bca468948c880aacdd2796655060 100644 (file)
@@ -51,9 +51,9 @@ gdb_test "attach $testpid2" \
     "attach to program 2"
 gdb_test "backtrace" ".*main.*" "backtrace 2"
 
-gdb_test "kill" "" "kill inferior 2" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill inferior 2" "Kill the program being debugged. .y or n. " "y"
 gdb_test "inferior 1" ".*Switching to inferior 1.*"
-gdb_test "kill" "" "kill inferior 1" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill inferior 1" "Kill the program being debugged. .y or n. " "y"
 
 kill_wait_spawned_process $test_spawn_id1
 kill_wait_spawned_process $test_spawn_id2
index f3e992a451c042fffe0897eaf1afaab0f2bbc948..881c6361837da197fc41f4ab160c985c3620e835 100644 (file)
@@ -68,7 +68,7 @@ gdb_test "attach $testpid" \
     "attach to remote program 2"
 gdb_test "backtrace" ".*main.*" "backtrace 2"
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 gdb_test_no_output "monitor exit"
 
 kill_wait_spawned_process $test_spawn_id
index 44c9b1f7076748ae7f56c06dc84851159f942e1d..d28ce4779f24bd1a59d3eef1f2ce3b5538e2e3ed 100644 (file)
@@ -60,6 +60,6 @@ with_test_prefix "restart" {
     }
 }
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 
 gdb_test_no_output "monitor exit"
index cdb1695fc6e8484927f83b47f0347c3c35c5b2f3..d8b3e92a705f9c9150b756eedfdbaa9b8d39987c 100644 (file)
@@ -61,7 +61,7 @@ if { [istarget *-*-linux*] } {
     }
 }
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 
 gdb_load $binfile
 gdb_test "monitor help" "The following monitor commands.*" \
index 8b1af7bcf423c981586c4d6304b6ce4321ff6e68..b195ae7efef868f95601f4409ecc7c4cb7652507 100644 (file)
@@ -65,6 +65,6 @@ with_test_prefix "restart" {
     gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
 }
 
-gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "kill" "" "kill" "Kill the program being debugged. .y or n. " "y"
 
 gdb_test_no_output "monitor exit"