]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/darwin-nat.c
gdb/darwin: skip over WIFSTOPPED wait4 status
authorDominique Quatravaux <dominique.quatravaux@epfl.ch>
Thu, 24 Feb 2022 14:23:21 +0000 (09:23 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 24 Feb 2022 15:48:37 +0000 (10:48 -0500)
commit7ff917016a203cdff3074abfcf96c1553944af94
treee2a5a9a3d7a868acdff2b2f87e5e705bd30ff2f5
parent0b313e95a73ad567915c9c1135d3d49f39236325
gdb/darwin: skip over WIFSTOPPED wait4 status

On modern Darwin's, there appears to be a new circumstance in which a
MACH_NOTIFY_DEAD_NAME message can be received, and which was not
previously accounted for: to signal the WIFSTOPPED condition in the
debuggee. In that case the debuggee is not dead yet (and in fact,
counting it as dead would cause a zombie leak - A process in such a
state reparents to PID 1, but cannot be killed).

 - Read and ignore such messages (counting on the next exception message
   to let us know of the inferior's new state again)
 - Refactor logging so as to clearly distinguish between the
   MACH_NOTIFY_DEAD_NAME cases (WIFEXITED, WIFSTOPPED, signal, or
   something else), and warn in the last case

Co-authored-by: Louis-He <1726110778@qq.com>
Co-authored-by: Philippe Blain <levraiphilippeblain@gmail.com>
Change-Id: Ie86904a894e9bd154e6b674b1bfbfbaee7fde3e1
gdb/darwin-nat.c