aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-script.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-06-14 17:47:03 +0100
committerPedro Alves <palves@redhat.com>2018-06-14 17:47:03 +0100
commit14897d65b5a279684289bf6b99136de60c31f1c0 (patch)
treec43e5f3fec0376c43c51cd34d883d4406651cadb /gdb/cli/cli-script.c
parent5d9a06087942ddf4f9ab724b5b4c1a45507d8321 (diff)
downloadbinutils-14897d65b5a279684289bf6b99136de60c31f1c0.zip
binutils-14897d65b5a279684289bf6b99136de60c31f1c0.tar.gz
binutils-14897d65b5a279684289bf6b99136de60c31f1c0.tar.bz2
Avoid gdb.base/fork-running-state.exp lingering processes
Currently, the gdb.base/fork-running-state.exp testcase leaves a few processes lingering until a 3 minutes alarm kills them: pedro 28308 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state pedro 28340 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state pedro 28372 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state pedro 28400 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state pedro 28431 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state pedro 28463 1 0 13:55 ? 00:00:00 /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/fork-running-state/fork-running-state Those processes used to kill themselves, but that was changed by commit f50d8a2eaea0 ("Fix gdb.base/fork-running-state.exp race"). This commit restores the self-killing, but only in the cases gdb won't try killing the processes, thus avoiding the old race. (The restored code in fork_parent isn't exactly the same as it was. In this version, we're exiting immediately when 'wait' returns success, while in the old version we'd loop again and end up in the perror call. The output from that perror call is not expected by the "kill inferior" tests, and would result in a test FAIL.) gdb/testsuite/ChangeLog: 2018-06-14 Pedro Alves <palves@redhat.com> * gdb.base/fork-running-state.c: Include <errno.h>. (exit_if_relative_exits): New. (fork_child): If 'exit_if_relative_exits' is true, exit if the parent exits. (fork_parent): If 'exit_if_relative_exits' is true, exit if the child exits.
Diffstat (limited to 'gdb/cli/cli-script.c')
0 files changed, 0 insertions, 0 deletions