Update year range in copyright notice of all files owned by the GDB project.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / thread-execl.exp
index d837fe4d1ce1cf492a2287878a7ba9b4138c43e3..4a8016c53a1202aa0d6dda6a094a882a420c6629 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2015 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,19 +28,33 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
     return -1
 }
 
-clean_restart ${binfile}
+# Run the test proper.  SCHEDLOCK specifies what scheduler-locking
+# should be set to.
 
-runto_main
+proc do_test { schedlock } {
+    global binfile
 
-# Get ourselves to the thread that execs
-gdb_breakpoint "thread_execler"
-gdb_test "continue" ".*thread_execler.*" "continue to thread start"
+    with_test_prefix "schedlock $schedlock" {
+       clean_restart ${binfile}
 
-# 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"
+       if ![runto_main] {
+           return 0
+       }
 
-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"
+    }
+}
+
+foreach schedlock {"off" "step" "on"} {
+    do_test $schedlock
+}
This page took 0.026233 seconds and 4 git commands to generate.