* gdb.threads/pthreads.exp: Wait for output and delay
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / pthreads.exp
index e58de79324e61e08440453ea19d5529e6142ae45..0703395d78bfaad200239518423c0cea44779ecb 100644 (file)
@@ -197,13 +197,11 @@ proc test_startup {} {
     # We should be able to do an info threads before starting any others.
     send_gdb "info threads\n"
     gdb_expect {
-       -re ".*Thread.*LWP.*main.*$gdb_prompt $" {
+       -re ".*Thread.*main.*$gdb_prompt $" {
            pass "info threads"
        }
        -re "\r\n$gdb_prompt $" {
-           pass "info threads"
-           setup_xfail "*-*-*"
-           fail "gdb does not support pthreads for this machine"
+           unsupported "gdb does not support pthreads for this machine"
            return 0
        }
     }
@@ -250,6 +248,15 @@ proc check_control_c {} {
 
     # Send a continue followed by ^C to the process to stop it.
     send_gdb "continue\n"
+    gdb_expect {
+       -re "Continuing." {
+           pass "Continue with all threads running"
+       }
+       timeout {
+           fail "Continue with all threads running (timeout)"
+       }
+    }
+    sleep 1
     set description "Stopped with a ^C"
     after 1000 [send_gdb "\003"]
     gdb_expect {
@@ -261,6 +268,7 @@ proc check_control_c {} {
        }
        timeout {
            fail "$description (timeout)"
+           return 1;
        }
     }
     gdb_test "bt" ""
@@ -269,6 +277,7 @@ proc check_control_c {} {
     if [all_threads_running] then {
        pass "All threads running after continuing from ^C stop"
     }
+    return 0;
 }
 
 proc check_backtraces {} {
@@ -339,7 +348,10 @@ setup_xfail "alpha-*-osf*"
 if [runto_main] then {
     clear_xfail "alpha-*-osf*"
     if [test_startup] then {
-       check_control_c
+       if [check_control_c] then {
+           warning "Could not stop child with ^C; skipping rest of tests.\n"
+           return;
+       }
        check_backtraces
     }
 }
This page took 0.026072 seconds and 4 git commands to generate.