2006-01-04 Michael Snyder <msnyder@redhat.com>

* gdb.base/checkpoint.c: New file.
	* gdb.base/checkpoint.exp: New file.
	* gdb.base/multi-fork.c: New file.
	* gdb.base/multi-fork.exp: New file.
	* gdb.base/pi.txt: New file (data for checkpoint.c test).
This commit is contained in:
Michael Snyder 2006-01-04 19:29:26 +00:00
parent f4d8531447
commit 099ac3dd7c
6 changed files with 1960 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2006-01-04 Michael Snyder <msnyder@redhat.com>
* gdb.base/checkpoint.c: New file.
* gdb.base/checkpoint.exp: New file.
* gdb.base/multi-fork.c: New file.
* gdb.base/multi-fork.exp: New file.
* gdb.base/pi.txt: New file (data for checkpoint.c test).
2006-01-04 Fred Fish <fnf@specifix.com>
* gdb.base/ptype.c (foo): Add typedef.

View File

@ -0,0 +1,62 @@
/* This testcase is part of GDB, the GNU debugger.
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Please email any bugs, comments, and/or additions to this file to:
bug-gdb@prep.ai.mit.edu */
#include <stdio.h>
long lines = 0;
main()
{
char linebuf[128];
FILE *in, *out;
char *tmp = &linebuf[0];
long i;
int c = 0;
in = fopen ("pi.txt", "r");
out = fopen ("copy1.txt", "w");
if (!in || !out)
{
fprintf (stderr, "File open failed\n");
exit (1);
}
for (i = 0; ; i++)
{
if (ftell (in) != i)
fprintf (stderr, "Input error at %d\n", i);
if (ftell (out) != i)
fprintf (stderr, "Output error at %d\n", i);
c = fgetc (in);
if (c == '\n')
lines++; /* breakpoint 1 */
if (c == EOF)
break;
fputc (c, out);
}
printf ("Copy complete.\n"); /* breakpoint 2 */
fclose (in);
fclose (out);
printf ("Deleting copy.\n"); /* breakpoint 3 */
unlink ("copy1.txt");
exit (0); /* breakpoint 4 */
}

View File

@ -0,0 +1,375 @@
# Copyright 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
if $tracelevel then {
strace $tracelevel
}
if { ![isnative] } then {
continue
}
# Until "set follow-fork-mode" and "catch fork" are implemented on
# other targets...
#
if {![istarget "*-*-linux*"]} then {
continue
}
set prms_id 0
set bug_id 0
set testfile "checkpoint"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
# Start with a fresh gdb
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
global gdb_prompt
#
# This tests gdb checkpoint and restart.
#
remote_download host ${srcdir}/${subdir}/pi.txt pi.txt
runto_main
set break1_loc [gdb_get_line_number "breakpoint 1"]
set break2_loc [gdb_get_line_number "breakpoint 2"]
set break3_loc [gdb_get_line_number "breakpoint 3"]
set break4_loc [gdb_get_line_number "breakpoint 4"]
gdb_breakpoint $break1_loc
gdb_test "continue" "breakpoint 1.*" "break1 start"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 two"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 three"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 four"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 five"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 six"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 seven"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 eight"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 nine"
gdb_test "checkpoint" "" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 ten"
gdb_test "checkpoint" "" ""
gdb_test "info checkpoints" \
" 10 .* 9 .* 8 .* 7 .* 6 .* 5 .* 4 .* 3 .* 2 .* 1 .*" \
"info checkpoints one"
delete_breakpoints
gdb_breakpoint $break2_loc
gdb_test "continue" "breakpoint 2.*" "break2 one"
gdb_test "restart 1" "Switching to .*breakpoint 1.*" "restart 1 one"
gdb_test "print i" " = 78" "verify i 1 one"
gdb_test "step" "if .c == EOF.*" "step in 1 one"
gdb_test "print lines" " = 1.*" "verify lines 1 one"
gdb_test "restart 2" "Switching to .*breakpoint 1.*" "restart 2 one"
gdb_test "step" "if .c == EOF.*" "step in 2 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 2 one"
gdb_test "print lines" " = 11.*" "verify lines 2 one"
gdb_test "restart 3" "Switching to .*breakpoint 1.*" "restart 3 one"
gdb_test "step" "if .c == EOF.*" "step in 3 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 3 one"
gdb_test "print lines" " = 21.*" "verify lines 3 one"
gdb_test "restart 4" "Switching to .*breakpoint 1.*" "restart 4 one"
gdb_test "step" "if .c == EOF.*" "step in 4 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 4 one"
gdb_test "print lines" " = 31.*" "verify lines 4 one"
gdb_test "restart 5" "Switching to .*breakpoint 1.*" "restart 5 one"
gdb_test "step" "if .c == EOF.*" "step in 5 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 5 one"
gdb_test "print lines" " = 41.*" "verify lines 5 one"
gdb_test "restart 6" "Switching to .*breakpoint 1.*" "restart 6 one"
gdb_test "step" "if .c == EOF.*" "step in 6 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 6 one"
gdb_test "print lines" " = 51.*" "verify lines 6 one"
gdb_test "restart 7" "Switching to .*breakpoint 1.*" "restart 7 one"
gdb_test "step" "if .c == EOF.*" "step in 7 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 7 one"
gdb_test "print lines" " = 61.*" "verify lines 7 one"
gdb_test "restart 8" "Switching to .*breakpoint 1.*" "restart 8 one"
gdb_test "step" "if .c == EOF.*" "step in 8 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 8 one"
gdb_test "print lines" " = 71.*" "verify lines 8 one"
gdb_test "restart 9" "Switching to .*breakpoint 1.*" "restart 9 one"
gdb_test "step" "if .c == EOF.*" "step in 9 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 9 one"
gdb_test "print lines" " = 81.*" "verify lines 9 one"
gdb_test "restart 10" "Switching to .*breakpoint 1.*" "restart 10 one"
gdb_test "step" "if .c == EOF.*" "step in 10 one"
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 10 one"
gdb_test "print lines" " = 91.*" "verify lines 10 one"
#
# Now let the files be closed by the original process,
# and diff them.
gdb_test "restart 0" "Switching to .*breakpoint 2.*" "restart 0 one"
gdb_breakpoint $break3_loc
gdb_test "continue" "breakpoint 3.*" "break3 one"
gdb_test "shell diff -s pi.txt copy1.txt" \
"Files pi.txt and copy1.txt are identical.*" \
"Diff input and output one"
#
# And now run from various checkpoints, allowing
# various amounts of input and output.
#
gdb_breakpoint $break1_loc
gdb_test "restart 1" "Switching to .*c == EOF.*" "restart 1 two"
gdb_test "continue" "" ""
gdb_test "continue 100" "breakpoint 1.*" "breakpoint 1 1 one"
gdb_test "step" "if .c == EOF.*" "step in 1 two"
gdb_test "print lines" " = 102.*" "verify lines 1 two"
gdb_test "restart 2" "Switching to .*c == EOF.*" "restart 2 two"
gdb_test "continue" "" ""
gdb_test "continue 100" "breakpoint 1.*" "breakpoint 1 2 one"
gdb_test "step" "if .c == EOF.*" "step in 2 two"
gdb_test "print lines" " = 112.*" "verify lines 2 two"
gdb_test "restart 3" "Switching to .*c == EOF.*" "restart 3 two"
gdb_test "continue" "" ""
gdb_test "continue 500" "breakpoint 1.*" "breakpoint 1 3 one"
gdb_test "step" "if .c == EOF.*" "step in 3 two"
gdb_test "print lines" " = 522.*" "verify lines 3 two"
gdb_test "restart 4" "Switching to .*c == EOF.*" "restart 4 two"
gdb_test "continue" "" ""
gdb_test "continue 500" "breakpoint 1.*" "breakpoint 1 4 one"
gdb_test "step" "if .c == EOF.*" "step in 4 two"
gdb_test "print lines" " = 532.*" "verify lines 4 two"
gdb_test "restart 5" "Switching to .*c == EOF.*" "restart 5 two"
gdb_test "continue" "" ""
gdb_test "continue 1000" "breakpoint 1.*" "breakpoint 1 5 one"
gdb_test "step" "if .c == EOF.*" "step in 5 two"
gdb_test "print lines" " = 1042.*" "verify lines 5 two"
gdb_test "restart 6" "Switching to .*c == EOF.*" "restart 6 two"
gdb_test "continue" "" ""
gdb_test "continue 1000" "breakpoint 1.*" "breakpoint 1 6 one"
gdb_test "step" "if .c == EOF.*" "step in 6 two"
gdb_test "print lines" " = 1052.*" "verify lines 5 two"
gdb_test "restart 7" "Switching to .*c == EOF.*" "restart 7 two"
gdb_test "continue" "" ""
gdb_test "continue 1100" "breakpoint 1.*" "breakpoint 1 7 one"
gdb_test "step" "if .c == EOF.*" "step in 7 two"
gdb_test "print lines" " = 1162.*" "verify lines 7 two"
gdb_test "shell diff -s pi.txt copy1.txt" \
"Files pi.txt and copy1.txt are identical.*" \
"Diff input and output two"
#
# OK, now allow the original program to delete the output file,
# and verify that the checkpoints can still write to it.
#
gdb_test "restart 0" "Switching to .*breakpoint 3.*" "restart 0 one"
gdb_breakpoint $break4_loc
gdb_test "continue" "breakpoint 4.*" "break4 one"
gdb_test "shell diff pi.txt copy1.txt" \
"diff: copy1.txt: No such file or directory" \
"delete copy1"
delete_breakpoints
gdb_breakpoint $break2_loc
gdb_test "restart 1" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 1 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 1"
gdb_test "restart 2" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 2 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 2"
gdb_test "restart 3" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 3 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 3"
gdb_test "restart 4" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 4 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 4"
gdb_test "restart 5" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 5 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 5"
gdb_test "restart 6" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 6 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 6"
gdb_test "restart 7" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 7 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 7"
gdb_test "restart 8" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 8 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 8"
gdb_test "restart 9" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 9 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 9"
gdb_test "restart 10" "if .c == EOF.*" "restart 1 three"
gdb_test "continue" "breakpoint 2.*" "break2 10 one"
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 10"
#
# Now confirm that if one fork exits, we automatically switch to another one.
#
delete_breakpoints
gdb_test "continue" \
"Deleting copy.*Program exited normally.*Switching to.*" \
"Exit, dropped into next fork one"
gdb_test "continue" \
"Deleting copy.*Program exited normally.*Switching to.*" \
"Exit, dropped into next fork two"
gdb_test "continue" \
"Deleting copy.*Program exited normally.*Switching to.*" \
"Exit, dropped into next fork three"
gdb_test "continue" \
"Deleting copy.*Program exited normally.*Switching to.*" \
"Exit, dropped into next fork four"
gdb_test "continue" \
"Deleting copy.*Program exited normally.*Switching to.*" \
"Exit, dropped into next fork five"
#
# There should be still at least five forks left
#
gdb_test "info checkpoints" " 5 .* 4 .* 3 .* 2 .* 1 .*" \
"info checkpoints two"
#
# Kill should now terminate all of them.
#
gdb_test "kill" "" "kill all one" \
"Kill the program being debugged.*y or n. $" "y"
#
# and confirm that all are gone
#
gdb_test "restart 0" "Not found.*" "no more checkpoint 0"
gdb_test "restart 1" "Not found.*" "no more checkpoint 1"
gdb_test "restart 2" "Not found.*" "no more checkpoint 2"
gdb_test "restart 3" "Not found.*" "no more checkpoint 3"
gdb_test "restart 4" "Not found.*" "no more checkpoint 4"
gdb_test "restart 5" "Not found.*" "no more checkpoint 5"
gdb_test "restart 6" "Not found.*" "no more checkpoint 6"
gdb_test "restart 7" "Not found.*" "no more checkpoint 7"
gdb_test "restart 8" "Not found.*" "no more checkpoint 8"
gdb_test "restart 9" "Not found.*" "no more checkpoint 9"
gdb_test "restart 10" "Not found.*" "no more checkpoint 10"
#
# Now let's try setting a large number of checkpoints (>1000)
#
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
runto_main
gdb_breakpoint $break1_loc
send_gdb "commands\n"
send_gdb " silent\n"
send_gdb " if (lines % 2)\n"
send_gdb " checkpoint\n"
send_gdb " end\n"
send_gdb " continue\n"
send_gdb "end\n"
gdb_expect {
-re ".*$gdb_prompt $" { pass "set checkpoint breakpoint" }
timeout { fail "(timeout) set checkpoint breakpoint" }
}
gdb_breakpoint $break2_loc
gdb_test "continue" "breakpoint 2.*" "break2 with many checkpoints"
gdb_test "info checkpoints" " 600 .* 0 .*" \
"info checkpoints with at least 600 checkpoints"
#
# OK, kill 'em all...
#
gdb_test "kill" "" "kill all one" \
"Kill the program being debugged.*y or n. $" "y"
#
# Finished: cleanup
#
remote_exec build "rm -f pi.txt"

View File

@ -0,0 +1,18 @@
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
pid_t pids[4];
main()
{
int i;
for (i = 0; i < 4; i++)
pids [i] = fork ();
printf ("%d ready\n", getpid ());
sleep (2);
printf ("%d done\n", getpid ());
exit (0); /* Set exit breakpoint here. */
}

View File

@ -0,0 +1,214 @@
# Copyright 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
if $tracelevel then {
strace $tracelevel
}
if { ![isnative] } then {
continue
}
# Until "set follow-fork-mode" and "catch fork" are implemented on
# other targets...
#
if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-*-linux*"]} then {
continue
}
set prms_id 0
set bug_id 0
set testfile "multi-forks"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
# Start with a fresh gdb
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
global gdb_prompt
# This is a test of gdb's ability to follow the parent, child or both
# parent and child of multiple Unix fork() system calls.
#
# Inferior program calls fork 4 times. Since each fork
# calls fork 4 times, there will be 16 forks. Each fork
# saves the return values of its own 4 fork calls.
# First set gdb to follow the child.
# The result should be that each of the 4 forks returns zero.
runto_main
set exit_bp_loc [gdb_get_line_number "Set exit breakpoint here."]
gdb_test "break $exit_bp_loc" "Breakpoint.* at .*" "Break at exit"
gdb_test "set follow child" "" ""
send_gdb "continue\n"
gdb_expect {
-re ".*Break.* main .*$gdb_prompt $" {}
-re ".*$gdb_prompt $" {fail "run to exit 1"}
default {fail "run to exit 1 (timeout)"}
}
gdb_test "print pids" "\\$.* = \\{0, 0, 0, 0\\}.*" "follow child, print pids"
# Now set gdb to follow the parent.
# Result should be that none of the 4 forks returns zero.
delete_breakpoints
runto_main
gdb_test "break $exit_bp_loc" "Breakpoint.* at .*" "Break at exit"
gdb_test "set follow parent" "" ""
send_gdb "continue\n"
gdb_expect {
-re ".*Break.* main .*$gdb_prompt $" {}
-re ".*$gdb_prompt $" {fail "run to exit 2"}
default {fail "run to exit 2 (timeout)"}
}
gdb_test "print pids\[0\]==0 || pids\[1\]==0 || pids\[2\]==0 || pids\[3\]==0" \
" = 0" "follow parent, print pids"
#
# Now test with detach-on-fork off.
#
runto_main
gdb_test "break $exit_bp_loc" "Breakpoint.* at .*" ""
gdb_test "help set detach-on-fork" "whether gdb will detach the child.*" \
"help set detach"
gdb_test "show detach-on-fork" "on." "show detach default on"
gdb_test "set detach off" "" "set detach off"
#
# We will now run every fork up to the exit bp,
# eventually winding up with 16 forks.
#
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 1"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 1"
gdb_test "restart 1" "_dl_sysinfo_int80.*" "restart 1"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 2"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 2"
gdb_test "restart 2" "_dl_sysinfo_int80.*" "restart 2"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 3"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 3"
gdb_test "restart 3" "_dl_sysinfo_int80.*" "restart 3"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 4"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 4"
gdb_test "restart 4" "_dl_sysinfo_int80.*" "restart 4"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 5"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 5"
gdb_test "restart 5" "_dl_sysinfo_int80.*" "restart 5"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 6"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 6"
gdb_test "restart 6" "_dl_sysinfo_int80.*" "restart 6"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 7"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 7"
gdb_test "restart 7" "_dl_sysinfo_int80.*" "restart 7"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 8"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 8"
gdb_test "restart 8" "_dl_sysinfo_int80.*" "restart 8"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 9"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 9"
gdb_test "restart 9" "_dl_sysinfo_int80.*" "restart 9"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 10"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 10"
gdb_test "restart 10" "_dl_sysinfo_int80.*" "restart 10"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 11"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 11"
gdb_test "restart 11" "_dl_sysinfo_int80.*" "restart 11"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 12"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 12"
gdb_test "restart 12" "_dl_sysinfo_int80.*" "restart 12"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 13"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 13"
gdb_test "restart 13" "_dl_sysinfo_int80.*" "restart 13"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 14"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 14"
gdb_test "restart 14" "_dl_sysinfo_int80.*" "restart 14"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 15"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 15"
gdb_test "restart 15" "_dl_sysinfo_int80.*" "restart 15"
gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 16"
gdb_test "info fork" " 4 .* 3 .* 2 .* 1 .*" "info fork 16"
gdb_test "restart 0" " main .*" "restart final"
#
# Now we should examine all the pids.
#
#
# Test detach-fork
#
# [assumes we're at #0]
gdb_test "detach-fork 1" "Detached .*" "Detach 1"
gdb_test "detach-fork 2" "Detached .*" "Detach 2"
gdb_test "detach-fork 3" "Detached .*" "Detach 3"
gdb_test "detach-fork 4" "Detached .*" "Detach 4"
#
# Test delete-fork
#
gdb_test "delete-fork 5" "" "Delete 5"
gdb_test "delete-fork 6" "" "Delete 6"
gdb_test "delete-fork 7" "" "Delete 7"
gdb_test "delete-fork 8" "" "Delete 8"
gdb_test "delete-fork 9" "" "Delete 9"
gdb_test "delete-fork 10" "" "Delete 10"
gdb_test "delete-fork 11" "" "Delete 11"
gdb_test "delete-fork 12" "" "Delete 12"
gdb_test "delete-fork 13" "" "Delete 13"
gdb_test "delete-fork 14" "" "Delete 14"
gdb_test "delete-fork 15" "" "Delete 15"
return 0

File diff suppressed because it is too large Load Diff