Blame SOURCES/gdb-6.5-bz243845-stale-testing-zombie-test.patch

01917d
diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp
01917d
--- gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp	1969-12-31 19:00:00.000000000 -0500
01917d
+++ gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp	2007-07-31 13:04:12.000000000 -0400
01917d
@@ -0,0 +1,75 @@
01917d
+# Copyright 2007 Free Software Foundation, Inc.
01917d
+
01917d
+# This program is free software; you can redistribute it and/or modify
01917d
+# it under the terms of the GNU General Public License as published by
01917d
+# the Free Software Foundation; either version 2 of the License, or
01917d
+# (at your option) any later version.
01917d
+# 
01917d
+# This program is distributed in the hope that it will be useful,
01917d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
01917d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
01917d
+# GNU General Public License for more details.
01917d
+# 
01917d
+# You should have received a copy of the GNU General Public License
01917d
+# along with this program; if not, write to the Free Software
01917d
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
01917d
+
01917d
+# are we on a target board
01917d
+if [is_remote target] then {
01917d
+    return 0
01917d
+}
01917d
+
01917d
+# Start the program running and then wait for a bit, to be sure
01917d
+# that it can be attached to.
01917d
+
01917d
+gdb_exit
01917d
+gdb_start
01917d
+gdb_load sleep
01917d
+
01917d
+set gdb_pid [exp_pid -i [board_info host fileid]]
01917d
+set test "identified the child GDB"
01917d
+if {$gdb_pid != "" && $gdb_pid > 0} {
01917d
+    pass $test
01917d
+    verbose -log "Child GDB PID $gdb_pid"
01917d
+} else {
01917d
+    fail $test
01917d
+}
01917d
+
01917d
+set testpid [eval exec sleep 10 &]
01917d
+exec sleep 2
01917d
+
01917d
+set test "attach"
01917d
+gdb_test_multiple "attach $testpid" "$test" {
01917d
+    -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" {
01917d
+	pass "$test"
01917d
+    }
01917d
+    -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
01917d
+	# Response expected on Cygwin
01917d
+	pass "$test"
01917d
+    }
01917d
+}
01917d
+
01917d
+# Some time to let GDB spawn its testing child.
01917d
+exec sleep 2
01917d
+
01917d
+set found none
01917d
+foreach procpid [glob -directory /proc -type d {[0-9]*}] {
01917d
+    if {[catch {open $procpid/status} statusfi]} {
01917d
+	continue
01917d
+    }
01917d
+    set status [read $statusfi]
01917d
+    close $statusfi
01917d
+    if {1
01917d
+         && [regexp -line {^Name:\tgdb$} $status]
01917d
+         && [regexp -line {^PPid:\t1$} $status]
01917d
+         && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} {
01917d
+	set found $procpid
01917d
+	verbose -log "Found linux_test_for_tracefork zombie PID $procpid"
01917d
+    }
01917d
+}
01917d
+set test "linux_test_for_tracefork leaves no zombie"
01917d
+if {$found eq {none}} {
01917d
+    pass $test
01917d
+} else {
01917d
+    fail $test
01917d
+}