FreeBSD 15 (out soon) and 16 (the dev branch) have changed the behaviour
of ptrace. When vgdb uses ptrace to get Valgrind to poll gdbserver
to get out of blocking syscalls the client may return a bogus result
from the syscall.
Setting the syscall to 0 turns off this change and all 3 affected testcases
should return to normal behaviour. However, setting the syscall needs root
privileges. So I've added a test to see if the syscall is present and set
to 1. If it is the prereq is not satisfied.
args: 1 10000000 0 -S-S-S-S
vgopts: --tool=memcheck --vgdb=yes --vgdb-prefix=./vgdb-prefix-mcinvokeWS
stderr_filter: filter_make_empty
-prereq: test -f vgdb.invoker
+prereq: test -f vgdb.invoker && ( ! ../tests/os_test freebsd || [ "$(sysctl -n debug.ptrace_attach_transparent 2>/dev/null || echo 0)" -eq 0 ] )
progB: invoker
argsB: 10 --vgdb-prefix=./vgdb-prefix-mcinvokeWS --wait=60 -c v.wait 0
# if the --wait is not enough, the test will fail or block
vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlcontrolc
stderr_filter: filter_stderr
# Bug 338633 nlcontrol hangs on arm64 currently.
-prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/os_test solaris
+prereq: test -e gdb -a -f vgdb.invoker && ( ! ../tests/os_test solaris ) && ( ! ../tests/os_test freebsd || [ "$(sysctl -n debug.ptrace_attach_transparent 2>/dev/null || echo 0)" -eq 0 ] )
progB: gdb
argsB: --quiet -l 60 --nx ./sleepers
stdinB: nlcontrolc.stdinB.gdb
args: 1 10000000 0 -S-S-S-S 1
vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlsigvgdb
stderr_filter: filter_stderr
-prereq: test -e gdb -a -f vgdb.invoker
+prereq: test -e gdb -a -f vgdb.invoker && ( ! ../tests/os_test freebsd || [ "$(sysctl -n debug.ptrace_attach_transparent 2>/dev/null || echo 0)" -eq 0 ] )
envB: LC_ALL=C
progB: gdb
argsB: --quiet -l 60 --nx ./sleepers