]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb testsuite: Introduce allow_fork_tests and use it throughout users/keiths/try-allow_fork_tests
authorKeith Seitz <keiths@redhat.com>
Fri, 6 Jun 2025 16:14:19 +0000 (09:14 -0700)
committerKeith Seitz <keiths@redhat.com>
Fri, 6 Jun 2025 16:17:34 +0000 (09:17 -0700)
commitd8b79a1f24f4c8c6068b548727009de14d77ee34
tree3b9390056172d49fd4d517a47240d68960f46a89
parentdbd830f14f791fa8d27afa08b258347b95608e57
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 be 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

Change-Id: I0c5e8c574d1f61b28d370c22a0b0b6bc3efaf978
31 files changed:
gdb/testsuite/gdb.base/catch-fork-kill.exp
gdb/testsuite/gdb.base/catch-fork-static.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.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