Process exit status is leader exit status testcase
authorLancelot SIX <lancelot.six@amd.com>
Fri, 18 Feb 2022 15:05:51 +0000 (10:05 -0500)
committerPedro Alves <pedro@palves.net>
Thu, 10 Mar 2022 11:35:54 +0000 (11:35 +0000)
commitc6479f8b2ab32c8a1659054104f2d0176a466cb3
treed7aa78820bd493e8534a84a0ada33cb4e9cf2119
parent8a841a3579bf1f8eb2414cbc3b2afae6bc59ac8a
Process exit status is leader exit status testcase

This adds a multi-threaded testcase that has all threads in the
process exit with a different exit code, and ensures that GDB reports
the thread group leader's exit status as the whole-process exit
status.  Before this set of patches, this would randomly report the
exit code of some other thread, and thus fail.

Tested on Linux-x86_64, native and gdbserver.

Co-Authored-By: Pedro Alves <pedro@palves.net>
Change-Id: I30cba2ff4576fb01b5169cc72667f3268d919557
gdb/testsuite/gdb.threads/process-exit-status-is-leader-exit-status.c [new file with mode: 0644]
gdb/testsuite/gdb.threads/process-exit-status-is-leader-exit-status.exp [new file with mode: 0644]