OLD | NEW |
1 # Copyright (C) 2009-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 2009-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # There's no support for `set follow-fork-mode' in the remote | 16 # There's no support for `set follow-fork-mode' in the remote |
17 # protocol. | 17 # protocol. |
18 if { [is_remote target] } { | 18 if { [is_remote target] } { |
19 return 0 | 19 return 0 |
20 } | 20 } |
21 | 21 |
22 # Only GNU/Linux is known to support `set follow-fork-mode child'. | 22 # Only GNU/Linux is known to support `set follow-fork-mode child'. |
23 # | 23 # |
24 if { ! [istarget "*-*-linux*"] } { | 24 if { ! [istarget "*-*-linux*"] } { |
25 return 0 | 25 return 0 |
26 } | 26 } |
27 | 27 |
28 set testfile fork-thread-pending | 28 standard_testfile |
29 set srcfile ${testfile}.c | |
30 set binfile ${objdir}/${subdir}/${testfile} | |
31 | 29 |
32 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le {debug}] != "" } { | 30 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le {debug}] != "" } { |
33 return -1 | 31 return -1 |
34 } | 32 } |
35 | 33 |
36 gdb_exit | 34 clean_restart ${binfile} |
37 gdb_start | |
38 gdb_reinitialize_dir $srcdir/$subdir | |
39 | 35 |
40 gdb_load ${binfile} | |
41 if ![runto_main] then { | 36 if ![runto_main] then { |
42 fail "Can't run to main" | 37 fail "Can't run to main" |
43 return 0 | 38 return 0 |
44 } | 39 } |
45 | 40 |
46 gdb_test_no_output "set follow-fork-mode child" "1, set follow-fork-mode child" | 41 gdb_test_no_output "set follow-fork-mode child" "1, set follow-fork-mode child" |
47 gdb_test "catch fork" "Catchpoint \[0-9\]* \\(fork\\)" "1, insert fork catchpoin
t" | 42 gdb_test "catch fork" "Catchpoint \[0-9\]* \\(fork\\)" "1, insert fork catchpoin
t" |
48 gdb_breakpoint "start" "" "1, set breakpoint at start" | 43 gdb_breakpoint "start" "" "1, set breakpoint at start" |
49 | 44 |
50 gdb_test "continue" "Catchpoint.*" "1, get to the fork event" | 45 gdb_test "continue" "Catchpoint.*" "1, get to the fork event" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 -re " Thread .* Thread .*$gdb_prompt $" { | 114 -re " Thread .* Thread .*$gdb_prompt $" { |
120 pass "$test" | 115 pass "$test" |
121 } | 116 } |
122 -re "$gdb_prompt $" { | 117 -re "$gdb_prompt $" { |
123 fail "$test (unknown output)" | 118 fail "$test (unknown output)" |
124 } | 119 } |
125 timeout { | 120 timeout { |
126 fail "$test (timeout)" | 121 fail "$test (timeout)" |
127 } | 122 } |
128 } | 123 } |
OLD | NEW |