OLD | NEW |
1 # Copyright 1997, 1999, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1997, 1999, 2007-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 if { [is_remote target] || ![isnative] } then { | 16 if { [is_remote target] || ![isnative] } then { |
17 continue | 17 continue |
18 } | 18 } |
19 | 19 |
| 20 # Until "set follow-fork-mode" and "catch vfork" are implemented on |
| 21 # other targets... |
| 22 # |
| 23 if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { |
| 24 continue |
| 25 } |
| 26 |
| 27 # Test to see if we are on an HP-UX 10.20 and if so, |
| 28 # do not run these tests as catching vfork is disabled for |
| 29 # 10.20. |
| 30 |
| 31 if [istarget "hppa*-hp-hpux10.20"] then { |
| 32 return 0 |
| 33 } |
20 | 34 |
21 # NOTE drow/2002-12-06: I don't know what the referenced kernel problem | 35 # NOTE drow/2002-12-06: I don't know what the referenced kernel problem |
22 # is, but it appears to be fixed in recent HP/UX versions. | 36 # is, but it appears to be fixed in recent HP/UX versions. |
23 | 37 |
24 ##if [istarget "hppa2.0w-hp-hpux*"] { | 38 ##if [istarget "hppa2.0w-hp-hpux*"] { |
25 ## warning "Don't run gdb.base/foll-vfork.exp until JAGaa43495 kernel problem i
s fixed." | 39 ## warning "Don't run gdb.base/foll-vfork.exp until JAGaa43495 kernel problem i
s fixed." |
26 ## return 0 | 40 ## return 0 |
27 ##} | 41 ##} |
28 | 42 |
29 global srcfile | 43 global srcfile |
30 set testfile "foll-vfork" | 44 set testfile "foll-vfork" |
31 set testfile2 "vforked-prog" | 45 set testfile2 "vforked-prog" |
32 set srcfile ${testfile}.c | 46 set srcfile ${testfile}.c |
33 set srcfile2 ${testfile2}.c | 47 set srcfile2 ${testfile2}.c |
34 set binfile ${objdir}/${subdir}/${testfile} | 48 set binfile ${objdir}/${subdir}/${testfile} |
35 set binfile2 ${objdir}/${subdir}/${testfile2} | 49 set binfile2 ${objdir}/${subdir}/${testfile2} |
36 | 50 |
37 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug}] != "" } { | 51 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug}] != "" } { |
38 untested foll-vfork.exp | 52 untested foll-vfork.exp |
39 return -1 | 53 return -1 |
40 } | 54 } |
41 | 55 |
42 if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {d
ebug}] != "" } { | 56 if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {d
ebug}] != "" } { |
43 untested foll-vfork.exp | 57 untested foll-vfork.exp |
44 return -1 | 58 return -1 |
45 } | 59 } |
46 | 60 |
47 | |
48 # Until "set follow-fork-mode" and "catch vfork" are implemented on | |
49 # other targets... | |
50 # | |
51 if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { | |
52 continue | |
53 } | |
54 | |
55 # Test to see if we are on an HP-UX 10.20 and if so, | |
56 # do not run these tests as catching vfork is disabled for | |
57 # 10.20. | |
58 | |
59 if [istarget "hppa*-hp-hpux10.20"] then { | |
60 return 0 | |
61 } | |
62 | |
63 # A few of these tests require a little more time than the standard | 61 # A few of these tests require a little more time than the standard |
64 # timeout allows. | 62 # timeout allows. |
65 set oldtimeout $timeout | 63 set oldtimeout $timeout |
66 set timeout [expr "$timeout + 10"] | 64 set timeout [expr "$timeout + 10"] |
67 | 65 |
68 proc check_vfork_catchpoints {} { | 66 proc check_vfork_catchpoints {} { |
69 global gdb_prompt | 67 global gdb_prompt |
70 global has_vfork_catchpoints | 68 global has_vfork_catchpoints |
71 | 69 |
72 # Verify that the system supports "catch vfork". | 70 # Verify that the system supports "catch vfork". |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 # generate to arrive, so that output doesn't get confused with | 156 # generate to arrive, so that output doesn't get confused with |
159 # any gdb_expected debugger output from a subsequent testpoint. | 157 # any gdb_expected debugger output from a subsequent testpoint. |
160 # | 158 # |
161 exec sleep 1 | 159 exec sleep 1 |
162 | 160 |
163 # Explicitly kill this child, or a subsequent rerun actually runs | 161 # Explicitly kill this child, or a subsequent rerun actually runs |
164 # the exec'd child, not the original program... | 162 # the exec'd child, not the original program... |
165 send_gdb "kill\n" | 163 send_gdb "kill\n" |
166 gdb_expect { | 164 gdb_expect { |
167 -re ".*Kill the program being debugged.*y or n. $" { | 165 -re ".*Kill the program being debugged.*y or n. $" { |
168 send_gdb "y\n" | 166 gdb_test_no_output "y" "" |
169 send_gdb "file $binfile\n" | 167 send_gdb "file $binfile\n" |
170 gdb_expect { | 168 gdb_expect { |
171 -re ".*Load new symbol table from.*y or n. $" { | 169 -re ".*Load new symbol table from.*y or n. $" { |
172 send_gdb "y\n" | 170 send_gdb "y\n" |
173 gdb_expect { | 171 gdb_expect { |
174 -re "Reading symbols from.*$gdb_prompt $" {} | 172 -re "Reading symbols from.*$gdb_prompt $" {} |
175 timeout { fail "loading symbols (timeout)"; return } | 173 timeout { fail "loading symbols (timeout)"; return } |
176 } | 174 } |
177 } | 175 } |
178 -re ".*gdb_prompt $" {} | 176 -re ".*gdb_prompt $" {} |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 # generate to arrive, so that output doesn't get confused with | 214 # generate to arrive, so that output doesn't get confused with |
217 # any expected debugger output from a subsequent testpoint. | 215 # any expected debugger output from a subsequent testpoint. |
218 # | 216 # |
219 exec sleep 1 | 217 exec sleep 1 |
220 | 218 |
221 # Explicitly kill this child, or a subsequent rerun actually runs | 219 # Explicitly kill this child, or a subsequent rerun actually runs |
222 # the exec'd child, not the original program... | 220 # the exec'd child, not the original program... |
223 send_gdb "kill\n" | 221 send_gdb "kill\n" |
224 gdb_expect { | 222 gdb_expect { |
225 -re ".*Kill the program being debugged.*y or n. $" { | 223 -re ".*Kill the program being debugged.*y or n. $" { |
226 send_gdb "y\n" | 224 gdb_test_no_output "y" "" |
227 send_gdb "file $binfile\n" | 225 send_gdb "file $binfile\n" |
228 gdb_expect { | 226 gdb_expect { |
229 -re ".*Load new symbol table from.*y or n. $" { | 227 -re ".*Load new symbol table from.*y or n. $" { |
230 send_gdb "y\n" | 228 send_gdb "y\n" |
231 gdb_expect { | 229 gdb_expect { |
232 -re "Reading symbols from.*$gdb_prompt $" {} | 230 -re "Reading symbols from.*$gdb_prompt $" {} |
233 timeout { fail "loading symbols (timeout)"; return } | 231 timeout { fail "loading symbols (timeout)"; return } |
234 } | 232 } |
235 } | 233 } |
236 -re ".*gdb_prompt $" {} | 234 -re ".*gdb_prompt $" {} |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 gdb_test_no_output "set verbose" | 396 gdb_test_no_output "set verbose" |
399 | 397 |
400 # This is a test of gdb's ability to follow the parent or child | 398 # This is a test of gdb's ability to follow the parent or child |
401 # of a Unix vfork() system call. (The child will subsequently | 399 # of a Unix vfork() system call. (The child will subsequently |
402 # call a variant of a Unix exec() system call.) | 400 # call a variant of a Unix exec() system call.) |
403 # | 401 # |
404 do_vfork_and_exec_tests | 402 do_vfork_and_exec_tests |
405 | 403 |
406 set timeout $oldtimeout | 404 set timeout $oldtimeout |
407 return 0 | 405 return 0 |
OLD | NEW |