/* Low-level child interface to ptrace.
- Copyright (C) 1988-2020 Free Software Foundation, Inc.
+ Copyright (C) 1988-2021 Free Software Foundation, Inc.
This file is part of GDB.
#endif
}
-/* A unique_ptr helper to unpush a target. */
-
-struct target_unpusher
-{
- void operator() (struct target_ops *ops) const
- {
- unpush_target (ops);
- }
-};
-
-/* A unique_ptr that unpushes a target on destruction. */
-
-typedef std::unique_ptr<struct target_ops, target_unpusher> target_unpush_up;
-
-\f
-
inf_ptrace_target::~inf_ptrace_target ()
{}
ptid_t
inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
- int options)
+ target_wait_flags options)
{
pid_t pid;
int status, save_errno;
}
/* Ignore terminated detached child processes. */
- if (!WIFSTOPPED (status) && pid != inferior_ptid.pid ())
+ if (!WIFSTOPPED (status) && find_inferior_pid (this, pid) == nullptr)
pid = -1;
}
while (pid == -1);