}
proc vfork_parent_follow_through_step {} {
+ with_test_prefix "vfork parent follow, through step" {
global gdb_prompt
- gdb_test_no_output "set follow-fork parent" \
- "set follow-fork parent, vfork through step"
+ gdb_test_no_output "set follow-fork parent"
- set test "vfork parent follow, through step"
+ set test "step"
gdb_test_multiple "next" $test {
-re "Detaching after fork from.*if \\(pid == 0\\).*$gdb_prompt " {
- pass "vfork parent follow, through step"
+ pass $test
}
}
# The child has been detached; allow time for any output it might
# any gdb_expected debugger output from a subsequent testpoint.
#
exec sleep 1
-}
+}}
proc vfork_parent_follow_to_bp {} {
+ with_test_prefix "vfork parent follow, to bp" {
global gdb_prompt
global srcfile
- gdb_test_no_output "set follow-fork parent" \
- "set follow-fork parent, vfork to bp"
+ gdb_test_no_output "set follow-fork parent"
set bp_location [gdb_get_line_number "printf (\"I'm the proud parent of child"]
gdb_test "break ${srcfile}:${bp_location}" ".*" "break, vfork to bp"
- set test "vfork parent follow, to bp"
+ set test "continue to bp"
gdb_test_multiple "continue" $test {
-re ".*Detaching after fork from child process.*Breakpoint.*${bp_location}.*$gdb_prompt " {
pass $test
# any expected debugger output from a subsequent testpoint.
#
exec sleep 1
-}
+}}
# Kill child and reload symbols.
proc kill_child {} {
}
proc vfork_and_exec_child_follow_to_main_bp {} {
+ with_test_prefix "vfork and exec child follow, to main bp" {
global gdb_prompt
global srcfile2
- gdb_test_no_output \
- "set follow-fork child" \
- "set follow-fork child, vfork and exec to main bp"
+ gdb_test_no_output "set follow-fork child"
set linenum [gdb_get_line_number "printf(\"Hello from vforked-prog" ${srcfile2}]
- set test "vfork and exec child follow, to main bp"
+ set test "continue to bp"
gdb_test_multiple "continue" $test {
-re "Attaching after.* vfork to.*xecuting new program.*Breakpoint.*vforked-prog.c:${linenum}.*$gdb_prompt " {
pass $test
# Explicitly kill this child, or a subsequent rerun actually runs
# the exec'd child, not the original program...
kill_child
-}
+}}
proc vfork_and_exec_child_follow_through_step {} {
+ with_test_prefix "vfork and exec child follow, through step" {
global gdb_prompt
global srcfile2
return 0
}
- gdb_test_no_output \
- "set follow-fork child" \
- "set follow-fork child, vfork and exec through step"
+ gdb_test_no_output "set follow-fork child"
- set test "vfork and exec child follow, through step"
+ set test "step over vfork"
if { [istarget "hppa*-*-hpux*"]} {
# Since the child cannot be debugged until after it has exec'd,
# and since there's a bp on "main" in the parent, and since the
# Explicitly kill this child, or a subsequent rerun actually runs
# the exec'd child, not the original program...
kill_child
-}
+}}
proc tcatch_vfork_then_parent_follow {} {
+ with_test_prefix "vfork parent follow, finish after tcatch vfork" {
global gdb_prompt
global srcfile
- gdb_test_no_output \
- "set follow-fork parent" \
- "set follow-fork parent, tcatch vfork"
+ gdb_test_no_output "set follow-fork parent"
- gdb_test "tcatch vfork" \
- "Catchpoint .*(vfork).*" \
- "vfork parent follow, set tcatch vfork"
+ gdb_test "tcatch vfork" "Catchpoint .*(vfork).*"
# HP-UX 10.20 seems to stop you in "vfork", while more recent
# HP-UXs stop you in "_vfork".
- set test "vfork parent follow, tcatch vfork"
+ set test "continue to vfork"
gdb_test_multiple "continue" $test {
-re "0x\[0-9a-fA-F\]*.*(vfork|__kernel_v?syscall).*$gdb_prompt " {
pass $test
}
set linenum [gdb_get_line_number "pid = vfork ();"]
- set test "vfork parent follow, finish after tcatch vfork"
+ set test "finish"
gdb_test_multiple "finish" $test {
-re "Run till exit from.*vfork.*0x\[0-9a-fA-F\]* in main .* at .*${srcfile}:${linenum}.*$gdb_prompt " {
pass $test
# any expected debugger output from a subsequent testpoint.
#
exec sleep 1
-}
+}}
proc tcatch_vfork_then_child_follow {} {
+ with_test_prefix "vfork child follow, finish after tcatch vfork" {
global gdb_prompt
global srcfile
global srcfile2
- gdb_test_no_output \
- "set follow-fork child" \
- "set follow-fork child, tcatch vfork"
+ gdb_test_no_output "set follow-fork child"
- gdb_test "tcatch vfork" \
- "Catchpoint .*(vfork).*" \
- "vfork child follow, set tcatch vfork"
+ gdb_test "tcatch vfork" "Catchpoint .*(vfork).*"
# HP-UX 10.20 seems to stop you in "vfork", while more recent HP-UXs
# stop you in "_vfork".
- set test "vfork child follow, tcatch vfork"
+ set test "continue to vfork"
gdb_test_multiple "continue" $test {
-re "vfork \\(\\) at .*$gdb_prompt $" {
pass $test
set linenum1 [gdb_get_line_number "pid = vfork ();"]
set linenum2 [gdb_get_line_number "printf(\"Hello from vforked-prog" ${srcfile2}]
- set test "vfork child follow, finish after tcatch vfork"
+ set test "finish"
gdb_test_multiple "finish" $test {
-re "Run till exit from.*vfork.*${srcfile}:${linenum1}.*$gdb_prompt " {
pass $test
# any expected debugger output from a subsequent testpoint.
#
exec sleep 1
-}
+}}
proc do_vfork_and_exec_tests {} {
global gdb_prompt