]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.threads/thread-execl.exp
follow-exec: delete all non-execing threads
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.threads / thread-execl.exp
index 4a8016c53a1202aa0d6dda6a094a882a420c6629..a598ad07ec528770bccf588506eecee39eda79b2 100644 (file)
@@ -34,9 +34,18 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 proc do_test { schedlock } {
     global binfile
 
-    with_test_prefix "schedlock $schedlock" {
+    if {$schedlock == "non-stop"} {
+       set prefix $schedlock
+    } else {
+       set prefix "schedlock $schedlock"
+    }
+    with_test_prefix "$prefix" {
        clean_restart ${binfile}
 
+       if {$schedlock == "non-stop"} {
+           gdb_test_no_output "set non-stop 1"
+       }
+
        if ![runto_main] {
            return 0
        }
@@ -45,16 +54,25 @@ proc do_test { schedlock } {
        gdb_breakpoint "thread_execler"
        gdb_test "continue" ".*thread_execler.*" "continue to thread start"
 
+       if {$schedlock == "non-stop"} {
+           gdb_test "thread 2" \
+               "Switching to .*thread_execler.*" \
+               "switch to event thread"
+       }
+
        # Now set a breakpoint at `main', and step over the execl call.  The
        # breakpoint at main should be reached.  GDB should not try to revert
        # back to the old thread from the old image and resume stepping it
        # (since it is gone).
        gdb_breakpoint "main"
-       gdb_test_no_output "set scheduler-locking $schedlock"
+
+       if {$schedlock != "non-stop"} {
+           gdb_test_no_output "set scheduler-locking $schedlock"
+       }
        gdb_test "next" ".*main.*" "get to main in new image"
     }
 }
 
-foreach schedlock {"off" "step" "on"} {
+foreach schedlock {"off" "step" "on" "non-stop"} {
     do_test $schedlock
 }