]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb testsuite: Introduce allow_fork_tests and use it throughout
authorPedro Alves <pedro@palves.net>
Thu, 1 Jun 2023 15:19:03 +0000 (16:19 +0100)
committerPedro Alves <pedro@palves.net>
Wed, 11 Jun 2025 14:03:25 +0000 (15:03 +0100)
commitf74bd9bcabce02de70169ea441d0ab6b8a2e2451
treebe765196f1350cb6dfb8abd05df1a7551b734fb6
parent43fe7696b89334b711040df916407489d50ac132
gdb testsuite: Introduce allow_fork_tests and use it throughout

Cygwin debugging does not support follow fork.  There is currently no
interface between the debugger and the Cygwin runtime to be able to
intercept forks and execs.  Consequently, testcases that try to
exercise fork/exec all FAIL, and several hit long cascading timeouts.

Add a new allow_fork_tests procedure, meant to be used with require,
and sprinkle it throughout testcases that exercise fork.

Note that some tests currently are skipped on targets other than
Linux, with something like:

 # Until "set follow-fork-mode" and "catch vfork" are implemented on
 # other targets...
 #
 if {![istarget "*-linux*"]} {
     continue
 }

However, some BSD ports also support fork debugging nowadays, and the
testcases were never adjusted...  That is why the new allow_fork_tests
procedure doesn't look for linux.

With this patch, on Cygwin, I get this:

 $ make check TESTS="*/*fork*.exp"

 ...
 === gdb Summary ===

 # of expected passes            6
 # of untested testcases         1
 # of unsupported tests          31

Reviewed-By: Keith Seitz <keiths@redhat.com>
Change-Id: I0c5e8c574d1f61b28d370c22a0b0b6bc3efaf978
37 files changed:
gdb/testsuite/gdb.base/catch-fork-kill.exp
gdb/testsuite/gdb.base/catch-fork-static.exp
gdb/testsuite/gdb.base/catch-signal-fork.exp
gdb/testsuite/gdb.base/foll-fork-syscall.exp
gdb/testsuite/gdb.base/foll-fork.exp
gdb/testsuite/gdb.base/foll-vfork.exp
gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp
gdb/testsuite/gdb.base/fork-print-inferior-events.exp
gdb/testsuite/gdb.base/fork-running-state.exp
gdb/testsuite/gdb.base/inferior-died.exp
gdb/testsuite/gdb.base/interrupt-daemon.exp
gdb/testsuite/gdb.base/jit-elf-fork.exp
gdb/testsuite/gdb.base/multi-forks.exp
gdb/testsuite/gdb.base/pie-fork.exp
gdb/testsuite/gdb.base/step-over-exit.exp
gdb/testsuite/gdb.base/vfork-follow-parent.exp
gdb/testsuite/gdb.base/watch-before-fork.exp
gdb/testsuite/gdb.base/watch-vfork.exp
gdb/testsuite/gdb.multi/watchpoint-multi-exit.exp
gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu.exp
gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu.exp
gdb/testsuite/gdb.rocm/precise-memory-fork.exp
gdb/testsuite/gdb.threads/foll-fork-other-thread.exp
gdb/testsuite/gdb.threads/fork-child-threads.exp
gdb/testsuite/gdb.threads/fork-plus-threads.exp
gdb/testsuite/gdb.threads/fork-thread-pending.exp
gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
gdb/testsuite/gdb.threads/next-fork-exec-other-thread.exp
gdb/testsuite/gdb.threads/next-fork-other-thread.exp
gdb/testsuite/gdb.threads/pending-fork-event-detach-ns.exp
gdb/testsuite/gdb.threads/pending-fork-event-detach.exp
gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp
gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp
gdb/testsuite/gdb.threads/vfork-multi-inferior.exp
gdb/testsuite/gdb.threads/vfork-multi-thread.exp
gdb/testsuite/gdb.threads/watchpoint-fork.exp
gdb/testsuite/lib/gdb.exp