Fix next over threaded execl with "set scheduler-locking step".
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / thread-execl.exp
index d837fe4d1ce1cf492a2287878a7ba9b4138c43e3..14b96d21d780a5c36044559c72b3a012830bab26 100644 (file)
@@ -28,19 +28,33 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
     return -1
 }
 
-clean_restart ${binfile}
-
-runto_main
-
-# Get ourselves to the thread that execs
-gdb_breakpoint "thread_execler"
-gdb_test "continue" ".*thread_execler.*" "continue to thread start"
-
-# 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 "next" ".*main.*" "get to main in new image"
+# Run the test proper.  SCHEDLOCK specifies what scheduler-locking
+# should be set to.
+
+proc do_test { schedlock } {
+    global binfile
+
+    with_test_prefix "schedlock $schedlock" {
+       clean_restart ${binfile}
+
+       if ![runto_main] {
+           return 0
+       }
+
+       # Get ourselves to the thread that execs.
+       gdb_breakpoint "thread_execler"
+       gdb_test "continue" ".*thread_execler.*" "continue to thread start"
+
+       # 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"
+       gdb_test "next" ".*main.*" "get to main in new image"
+    }
+}
 
-return 0
+foreach schedlock {"off" "step" "on"} {
+    do_test $schedlock
+}
This page took 0.031145 seconds and 4 git commands to generate.