Re: [PATCH] Don't compare the pid returned from wait() against inferior_ptid.

Eli Zaretskii
2020-07-09T17:34:28Z

> From: John Baldwin <jhb@FreeBSD.org>
> Date: Thu, 9 Jul 2020 09:37:05 -0700
> Cc: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
>
> Don't compare the pid returned from wait() against inferior_ptid.
>
> inf_ptrace::wait() needs to discard termination events reported by
> detached child processes. Previously it compared the returned pid
> against the pid in inferior_ptid to determine if a termination event
> should be discarded or reported. The multi-target changes cleared
> inferior_ptid to null_ptid in wait() target methods, so this was
> always failing and never reporting exit events. Instead, report
> termination events whose pid matches any inferior belonging to the
> current target.

Thanks.

Please allow me a minor stylistic nit: using "foo()" to indicate a
function call is suboptimal, and potentially confusing: it looks like
calling a function with no arguments, which is not what you want. It
is better to use 'foo' instead.