inf-ptrace: Return an IGNORE event if waitpid() fails.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Feb 2022 19:22:14 +0000 (11:22 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Feb 2022 19:22:14 +0000 (11:22 -0800)
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

index 6e4706a3d20a6fc0dd7e964f34eac33fbf5b64da..0b94aad54d7d9013928dbc5b639cdb1925c19d9b 100644 (file)
@@ -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.  */