]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.5-bz243845-stale-testing-zombie-test.patch
- typo
[packages/gdb.git] / gdb-6.5-bz243845-stale-testing-zombie-test.patch
CommitLineData
3a58abaf
AM
1diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp
2--- gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp 1969-12-31 19:00:00.000000000 -0500
3+++ gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp 2007-07-31 13:04:12.000000000 -0400
51a5ef0f 4@@ -0,0 +1,75 @@
3a58abaf
AM
5+# Copyright 2007 Free Software Foundation, Inc.
6+
7+# This program is free software; you can redistribute it and/or modify
8+# it under the terms of the GNU General Public License as published by
9+# the Free Software Foundation; either version 2 of the License, or
10+# (at your option) any later version.
11+#
12+# This program is distributed in the hope that it will be useful,
13+# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+# GNU General Public License for more details.
16+#
17+# You should have received a copy of the GNU General Public License
18+# along with this program; if not, write to the Free Software
19+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20+
3a58abaf
AM
21+# are we on a target board
22+if [is_remote target] then {
23+ return 0
24+}
25+
26+# Start the program running and then wait for a bit, to be sure
27+# that it can be attached to.
28+
29+gdb_exit
30+gdb_start
31+gdb_load sleep
32+
33+set gdb_pid [exp_pid -i [board_info host fileid]]
34+set test "identified the child GDB"
35+if {$gdb_pid != "" && $gdb_pid > 0} {
36+ pass $test
37+ verbose -log "Child GDB PID $gdb_pid"
38+} else {
39+ fail $test
40+}
41+
42+set testpid [eval exec sleep 10 &]
43+exec sleep 2
44+
45+set test "attach"
46+gdb_test_multiple "attach $testpid" "$test" {
47+ -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" {
48+ pass "$test"
49+ }
50+ -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
51+ # Response expected on Cygwin
52+ pass "$test"
53+ }
54+}
55+
56+# Some time to let GDB spawn its testing child.
57+exec sleep 2
58+
59+set found none
60+foreach procpid [glob -directory /proc -type d {[0-9]*}] {
61+ if {[catch {open $procpid/status} statusfi]} {
62+ continue
63+ }
64+ set status [read $statusfi]
65+ close $statusfi
66+ if {1
67+ && [regexp -line {^Name:\tgdb$} $status]
68+ && [regexp -line {^PPid:\t1$} $status]
69+ && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} {
70+ set found $procpid
71+ verbose -log "Found linux_test_for_tracefork zombie PID $procpid"
72+ }
73+}
74+set test "linux_test_for_tracefork leaves no zombie"
75+if {$found eq {none}} {
76+ pass $test
77+} else {
78+ fail $test
79+}
This page took 0.172485 seconds and 4 git commands to generate.