mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 06:17:47 +08:00
[gdb/testsuite] Fix DUPLICATEs in gdb.base/multi-forks.exp
When running test-case gdb.base/multi-forks.exp I get: ... DUPLICATE: gdb.base/multi-forks.exp: run to exit 2 DUPLICATE: gdb.base/multi-forks.exp: run to exit 2 ... Fix these by using test_with_prefix. Tested on x86_64-linux.
This commit is contained in:
@ -104,26 +104,32 @@ proc continue_to_exit_bp_loc {} {
|
|||||||
# zero means to take the child's branch; a pid means to take the
|
# zero means to take the child's branch; a pid means to take the
|
||||||
# parent's branch.
|
# parent's branch.
|
||||||
|
|
||||||
# First set gdb to follow the child.
|
foreach mode { "child" "parent" } {
|
||||||
# The result should be that each of the 4 forks returns zero.
|
clean_restart ${binfile}
|
||||||
|
runto_main
|
||||||
|
|
||||||
clean_restart ${binfile}
|
gdb_test_no_output "set follow-fork $mode"
|
||||||
runto_main
|
with_test_prefix "follow $mode" {
|
||||||
gdb_test_no_output "set follow-fork child"
|
continue_to_exit_bp_loc
|
||||||
continue_to_exit_bp_loc
|
|
||||||
|
|
||||||
gdb_test "print pids" "\\$.* = \\{0, 0, 0, 0\\}.*" "follow child, print pids"
|
set test "print pids"
|
||||||
|
if { $mode eq "child" } {
|
||||||
# Now set gdb to follow the parent.
|
# Gdb is set to follow the child.
|
||||||
# Result should be that none of the 4 forks returns zero.
|
# The result should be that each of the 4 forks returns zero.
|
||||||
|
gdb_test "print pids" "\\$.* = \\{0, 0, 0, 0\\}.*" $test
|
||||||
clean_restart ${binfile}
|
} else {
|
||||||
runto_main
|
# Gdb is set to follow the parent.
|
||||||
gdb_test_no_output "set follow-fork parent" ""
|
# Result should be that none of the 4 forks returns zero.
|
||||||
continue_to_exit_bp_loc
|
set val \
|
||||||
|
[join [list \
|
||||||
gdb_test "print pids\[0\]==0 || pids\[1\]==0 || pids\[2\]==0 || pids\[3\]==0" \
|
"pids\[0\]==0" \
|
||||||
" = 0" "follow parent, print pids"
|
"pids\[1\]==0" \
|
||||||
|
"pids\[2\]==0" \
|
||||||
|
"pids\[3\]==0"] " || "]
|
||||||
|
gdb_test "print $val" " = 0" $test
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Now test with detach-on-fork off.
|
# Now test with detach-on-fork off.
|
||||||
|
Reference in New Issue
Block a user