From: John Baldwin Date: Tue, 22 Feb 2022 19:22:14 +0000 (-0800) Subject: inf-ptrace: Return an IGNORE event if waitpid() fails. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=85e8c48c73a5c39a6980f9b2bd16ec96062fc4c3;p=binutils-gdb.git inf-ptrace: Return an IGNORE event if waitpid() fails. Previously this returned a TARGET_WAITKIND_SIGNALLED event for inferior_ptid. However, inferior_ptid is invalid during ::wait() methods after the multi-target changes, so this was triggering an assertion further up the stack. --- diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 6e4706a3d20..0b94aad54d7 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -313,9 +313,8 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, _("Child process unexpectedly missing: %s.\n"), safe_strerror (save_errno)); - /* Claim it exited with unknown signal. */ - ourstatus->set_signalled (GDB_SIGNAL_UNKNOWN); - return inferior_ptid; + ourstatus->set_ignore (); + return minus_one_ptid; } /* Ignore terminated detached child processes. */