1 # Copyright 2010-2015 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 set executable ${testfile}
19 if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
20 untested ${testfile}.exp
24 clean_restart $executable
30 # `noprint' would not test the full logic of GDB.
31 gdb_test "handle SIGUSR1 nostop print pass" \
32 "\r\nSIGUSR1\[ \t\]+No\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
34 gdb_test_no_output "set scheduler-locking off"
36 gdb_breakpoint [gdb_get_line_number "step-1"]
37 gdb_test_no_output {set $step1=$bpnum}
38 gdb_continue_to_breakpoint "step-1" ".* step-1 .*"
39 gdb_test_no_output {disable $step1}
41 # 1 as we are now stopped at the `step-1' label.
43 for {set i 0} {$i < 100} {incr i} {
45 # Presume this step failed - as in the case of a timeout.
47 gdb_test_multiple "step" $test {
48 -re "\r\nProgram received signal SIGUSR1, User defined signal 1.\r\n" {
49 exp_continue -continue_timer
51 -re "step-(\[012\]).*\r\n$gdb_prompt $" {
52 set now $expect_out(1,string)
53 if {$step_at == 2 && $now == 1} {
55 } elseif {$step_at == 1 && $now == 2} {
57 # Continue over the re-signalling back to the handle entry.
58 gdb_test_no_output {enable $step1} ""
59 gdb_test "continue" " step-1 .*" ""
61 gdb_test_no_output {disable $step1} ""
72 # We can never reliably say the racy problematic case has been tested.