From 85e8c48c73a5c39a6980f9b2bd16ec96062fc4c3 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 22 Feb 2022 11:22:14 -0800 Subject: 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. --- gdb/inf-ptrace.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gdb') diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 6e4706a..0b94aad 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. */ -- cgit v1.1