gdb/testsuite/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 26 Dec 2011 11:24:55 +0000 (11:24 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 26 Dec 2011 11:24:55 +0000 (11:24 +0000)
Fix double send_gdb leading to racy FAILs.
* gdb.base/break.exp (set silent break bp_location1): Replace
3x send_gdb and gdb_expect by gdb_test.
* gdb.base/fileio.exp: Replace 2x send_gdb by gdb_exit and sleep.
* gdb.base/foll-vfork.exp (vfork_and_exec_child_follow_to_main_bp)
(vfork_and_exec_child_follow_through_step): Use gdb_test_no_output
instead of send_gdb.  Twice.
* gdb.base/sepdebug.exp (set silent break bp_location1): Replace
3x send_gdb and gdb_expect by gdb_test.
* gdb.mi/mi-nsmoribund.exp: Replace 3x send_gdb by mi_gdb_test.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/break.exp
gdb/testsuite/gdb.base/fileio.exp
gdb/testsuite/gdb.base/foll-vfork.exp
gdb/testsuite/gdb.base/sepdebug.exp
gdb/testsuite/gdb.mi/mi-nsmoribund.exp

index c32c048cb2cb246e879f97fb472f9bbff86d85d3..9b540e463020b1f958ea099e2fd390f26fdcc5f9 100644 (file)
@@ -1,3 +1,16 @@
+2011-12-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix double send_gdb leading to racy FAILs.
+       * gdb.base/break.exp (set silent break bp_location1): Replace
+       3x send_gdb and gdb_expect by gdb_test.
+       * gdb.base/fileio.exp: Replace 2x send_gdb by gdb_exit and sleep.
+       * gdb.base/foll-vfork.exp (vfork_and_exec_child_follow_to_main_bp)
+       (vfork_and_exec_child_follow_through_step): Use gdb_test_no_output
+       instead of send_gdb.  Twice.
+       * gdb.base/sepdebug.exp (set silent break bp_location1): Replace
+       3x send_gdb and gdb_expect by gdb_test.
+       * gdb.mi/mi-nsmoribund.exp: Replace 3x send_gdb by mi_gdb_test.
+
 2011-12-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.linespec/linespec.exp: Compile using {c++}.
index 6d6f3108a0afd658b5946c07407b17c016b4a994..2292373ea2a6d221bee927cfd6dfa802e1f4f40f 100644 (file)
@@ -576,14 +576,7 @@ gdb_test_multiple "break $bp_location1" \
        }
     }
 
-send_gdb "commands $expect_out(1,string)\n"
-send_gdb "silent\n"
-send_gdb "end\n"
-gdb_expect {
-  -re ".*$gdb_prompt $"\
-          {pass "set silent break bp_location1"}
-  timeout {fail "(timeout) set silent break bp_location1"}
-}
+gdb_test "commands $expect_out(1,string)\nsilent\nend" ">end" "set silent break bp_location1"
 
 gdb_test "info break $expect_out(1,string)" \
     "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*" \
index a145e2b1fb7593ec9133cbd3cb152d4a29907668..101da154b61bea6673ca3eb4a9fd25592e4f9256 100644 (file)
@@ -247,8 +247,9 @@ gdb_test continue \
 "Continuing\\..*time 2:.*OK$stop_msg" \
 "Time(2) returns feasible values"
 
-send_gdb "quit\n"
-send_gdb "y\n"
+gdb_exit
+# Wait till GDB really exits.
+sleep 1
 
 remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
 remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
index f8a3eeb1f505913ede1f2a4095c11291447c652b..1982f9efe391c89ea7e266dbaab37ef3efa8e544 100644 (file)
@@ -166,7 +166,7 @@ proc vfork_and_exec_child_follow_to_main_bp {} {
    send_gdb "kill\n"
    gdb_expect {
       -re ".*Kill the program being debugged.*y or n. $" {
-         send_gdb "y\n"
+         gdb_test_no_output "y" ""
          send_gdb "file $binfile\n"
          gdb_expect {
             -re ".*Load new symbol table from.*y or n. $" {
@@ -224,7 +224,7 @@ proc vfork_and_exec_child_follow_through_step {} {
    send_gdb "kill\n"
    gdb_expect {
       -re ".*Kill the program being debugged.*y or n. $" {
-         send_gdb "y\n"
+         gdb_test_no_output "y" ""
          send_gdb "file $binfile\n"
          gdb_expect {
             -re ".*Load new symbol table from.*y or n. $" {
index 90fe4ecca841e4cf74059735601e00ad24d216a0..57ce30586117b5d9aa87e72552a31108ff844c41 100644 (file)
@@ -370,14 +370,7 @@ gdb_test_multiple "break $bp_location1" \
        }
 }
 
-send_gdb "commands $expect_out(1,string)\n"
-send_gdb "silent\n"
-send_gdb "end\n"
-gdb_expect {
-  -re ".*$gdb_prompt $"\
-          {pass "set silent break bp_location1"}
-  timeout {fail "(timeout) set silent break bp_location1"}
-}
+gdb_test "commands $expect_out(1,string)\nsilent\nend" ">end" "set silent break bp_location1"
 
 gdb_test "info break $expect_out(1,string)" \
     "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*" \
index 286004b7b6386bfa152c357147132ff8b20e419e..10b04ba51f37de3328e86e4d073c3069b9ec9d37 100644 (file)
@@ -118,9 +118,9 @@ mi_check_thread_states \
 # we are interested in, so we can't use mi_gdb_test or
 # gdb_test_multiple (or an MI equivalent)
 
-send_gdb "102-break-delete\n"
-send_gdb "print done = 1\n"
-send_gdb "103-exec-continue --all\n"
+mi_gdb_test "102-break-delete" "102\\^done.*"
+mi_gdb_test "print done = 1" { = 1"}
+mi_gdb_test "103-exec-continue --all" "\[^\n\]*\r\n$running_re"
 
 gdb_expect {
     -re "\\*stopped,reason=\"exited-normally\"" {
This page took 0.04156 seconds and 4 git commands to generate.