return options;
}
-/* Initialize ptrace warnings and check for supported ptrace
- features given PID.
+/* Initialize ptrace and procfs warnings and check for supported
+ ptrace features given PID.
ATTACHED should be nonzero iff we attached to the inferior. */
static void
-linux_init_ptrace (pid_t pid, int attached)
+linux_init_ptrace_procfs (pid_t pid, int attached)
{
int options = linux_nat_ptrace_options (attached);
linux_enable_event_reporting (pid, options);
linux_ptrace_init_warnings ();
+ linux_proc_init_warnings ();
}
linux_nat_target::~linux_nat_target ()
void
linux_nat_target::post_attach (int pid)
{
- linux_init_ptrace (pid, 1);
+ linux_init_ptrace_procfs (pid, 1);
}
void
linux_nat_target::post_startup_inferior (ptid_t ptid)
{
- linux_init_ptrace (ptid.pid (), 0);
+ linux_init_ptrace_procfs (ptid.pid (), 0);
}
/* Return the number of known LWPs in the tgid given by PID. */
{
struct lwp_info *lp;
- gdb_assert (ptid_lwp_p (ptid));
+ gdb_assert (ptid.lwp_p ());
lp = XNEW (struct lwp_info);
int lwp;
struct lwp_info dummy;
- if (ptid_lwp_p (ptid))
+ if (ptid.lwp_p ())
lwp = ptid.lwp ();
else
lwp = ptid.pid ();
{
lpnext = lp->next;
- if (ptid_match (lp->ptid, filter))
+ if (lp->ptid.matches (filter))
{
if ((*callback) (lp, data) != 0)
return lp;
target_pid_to_str (inferior_ptid));
/* A specific PTID means `step only this process id'. */
- resume_many = (ptid_equal (minus_one_ptid, ptid)
- || ptid_is_pid (ptid));
+ resume_many = (minus_one_ptid == ptid
+ || ptid.is_pid ());
/* Mark the lwps we're resuming as resumed. */
iterate_over_lwps (ptid, resume_set_callback, NULL);
/* The first time we get here after starting a new inferior, we may
not have added it to the LWP list yet - this is the earliest
moment at which we know its PID. */
- if (ptid_is_pid (inferior_ptid))
+ if (inferior_ptid.is_pid ())
{
/* Upgrade the main thread's ptid. */
thread_change_ptid (inferior_ptid,
/* If we're not waiting for a specific LWP, choose an event LWP from
among those that have had events. Giving equal priority to all
LWPs that have had events helps prevent starvation. */
- if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+ if (ptid == minus_one_ptid || ptid.is_pid ())
select_event_lwp (ptid, &lp, &status);
gdb_assert (lp != NULL);
/* Don't bother if there's a breakpoint at PC that we'd hit
immediately, and we're not waiting for this LWP. */
- if (!ptid_match (lp->ptid, *wait_ptid_p))
+ if (!lp->ptid.matches (*wait_ptid_p))
{
if (breakpoint_inserted_here_p (regcache->aspace (), pc))
leave_stopped = 1;
if (target_is_async_p ()
&& ((ourstatus->kind != TARGET_WAITKIND_IGNORE
&& ourstatus->kind != TARGET_WAITKIND_NO_RESUMED)
- || !ptid_equal (ptid, minus_one_ptid)))
+ || ptid != minus_one_ptid))
async_file_mark ();
return event_ptid;
/* The target is connected but no live inferior is selected. Pass
this request down to a lower stratum (e.g., the executable
file). */
- if (object == TARGET_OBJECT_MEMORY && ptid_equal (inferior_ptid, null_ptid))
+ if (object == TARGET_OBJECT_MEMORY && inferior_ptid == null_ptid)
return TARGET_XFER_EOF;
if (object == TARGET_OBJECT_AUXV)
{
static char buf[64];
- if (ptid_lwp_p (ptid)
+ if (ptid.lwp_p ()
&& (ptid.pid () != ptid.lwp ()
|| num_lwps (ptid.pid ()) > 1))
{
ptid_t
current_lwp_ptid (void)
{
- gdb_assert (ptid_lwp_p (inferior_ptid));
+ gdb_assert (inferior_ptid.lwp_p ());
return inferior_ptid;
}