-/* Copyright (C) 2009-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2020 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;
if (lynx_ptrace (PTRACE_ATTACH, ptid, 0, 0, 0) != 0)
error ("Cannot attach to process %lu: %s (%d)\n", pid,
- strerror (errno), errno);
+ safe_strerror (errno), errno);
lynx_add_process (pid, 1);
lynx_add_threads_after_attach (pid);
/* 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 join target_ops method. */
static void
-lynx_join (process_info *proc)
+lynx_join (int pid)
{
/* The PTRACE_DETACH is sufficient to detach from the process.
So no need to do anything extra. */
/* The LynxOS target_ops vector. */
-static struct target_ops lynx_target_ops = {
+static process_stratum_target lynx_target_ops = {
lynx_create_inferior,
NULL, /* post_create_inferior */
lynx_attach,
NULL, /* stopped_data_address */
NULL, /* read_offsets */
NULL, /* get_tls_address */
- NULL, /* qxfer_spu */
NULL, /* hostio_last_error */
NULL, /* qxfer_osdata */
NULL, /* qxfer_siginfo */