-/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
-#include "gdb_wait.h"
+#include "gdbsupport/gdb_wait.h"
#include <signal.h>
-#include "filestuff.h"
-#include "common-inferior.h"
+#include "gdbsupport/filestuff.h"
+#include "gdbsupport/common-inferior.h"
#include "nat/fork-inferior.h"
int using_threads = 1;
{
/* See lynx_ptid_t: The LynxOS tid is stored inside the lwp field
of the ptid. */
- return ptid_get_lwp (ptid);
+ return ptid.lwp ();
}
/* For a given PTID, return the associated PID as known by the LynxOS
LynxOS 178 is a little more sensitive, and triggers some
unexpected signals (Eg SIG61) when we resume the inferior
using a different thread. */
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
ptid = current_process()->priv->last_wait_event_ptid;
/* The ptid might still be minus_one_ptid; this can happen between
the moment we create the inferior or attach to a process, and
the moment we resume its execution for the first time. It is
fine to use the current_thread's ptid in those cases. */
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
ptid = ptid_of (current_thread);
regcache_invalidate_pid (ptid.pid ());
int wstat;
ptid_t new_ptid;
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
pid = lynx_ptid_get_pid (ptid_of (current_thread));
else
pid = BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid));
/* Implement the kill target_ops method. */
static int
-lynx_kill (int pid)
+lynx_kill (process_info *process)
{
- ptid_t ptid = lynx_ptid_t (pid, 0);
+ ptid_t ptid = lynx_ptid_t (process->pid, 0);
struct target_waitstatus status;
- struct process_info *process;
-
- process = find_process_pid (pid);
- if (process == NULL)
- return -1;
lynx_ptrace (PTRACE_KILL, ptid, 0, 0, 0);
lynx_wait (ptid, &status, 0);
/* Implement the detach target_ops method. */
static int
-lynx_detach (int pid)
+lynx_detach (process_info *process)
{
- ptid_t ptid = lynx_ptid_t (pid, 0);
- struct process_info *process;
-
- process = find_process_pid (pid);
- if (process == NULL)
- return -1;
+ ptid_t ptid = lynx_ptid_t (process->pid, 0);
lynx_ptrace (PTRACE_DETACH, ptid, 0, 0, 0);
the_target->mourn (process);
NULL, /* stopped_data_address */
NULL, /* read_offsets */
NULL, /* get_tls_address */
- NULL, /* qxfer_spu */
NULL, /* hostio_last_error */
NULL, /* qxfer_osdata */
NULL, /* qxfer_siginfo */