/* GNU/Linux native-dependent code common to multiple platforms.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
This file is part of GDB.
}
/* Initialize ptrace warnings and check for supported ptrace
- features given PID. */
+ features given PID.
+
+ ATTACHED should be nonzero iff we attached to the inferior. */
static void
-linux_init_ptrace (pid_t pid)
+linux_init_ptrace (pid_t pid, int attached)
{
- linux_enable_event_reporting (pid);
+ linux_enable_event_reporting (pid, attached);
linux_ptrace_init_warnings ();
}
static void
linux_child_post_attach (struct target_ops *self, int pid)
{
- linux_init_ptrace (pid);
+ linux_init_ptrace (pid, 1);
}
static void
linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
{
- linux_init_ptrace (ptid_get_pid (ptid));
+ linux_init_ptrace (ptid_get_pid (ptid), 0);
}
/* Return the number of known LWPs in the tgid given by PID. */
{
if (lp->stopped)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid));
+ struct inferior *inf = find_inferior_ptid (lp->ptid);
if (inf->vfork_child != NULL)
{
static int
stop_wait_callback (struct lwp_info *lp, void *data)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid));
+ struct inferior *inf = find_inferior_ptid (lp->ptid);
/* If this is a vfork parent, bail out, it is not going to report
any SIGSTOP until the vfork is done with. */
ptid_t ptid, struct target_waitstatus *ourstatus,
int target_options)
{
- static sigset_t prev_mask;
+ sigset_t prev_mask;
enum resume_kind last_resume_kind;
struct lwp_info *lp;
int status;