/* Low-level child interface to ptrace.
- Copyright (C) 1988-2015 Free Software Foundation, Inc.
+ Copyright (C) 1988-2016 Free Software Foundation, Inc.
This file is part of GDB.
#include "terminal.h"
#include "gdbcore.h"
#include "regcache.h"
-#include "gdb_ptrace.h"
+#include "nat/gdb_ptrace.h"
#include "gdb_wait.h"
#include <signal.h>
return 0;
}
+static int
+inf_ptrace_insert_fork_catchpoint (struct target_ops *self, int pid)
+{
+ return 0;
+}
+
+static int
+inf_ptrace_remove_fork_catchpoint (struct target_ops *self, int pid)
+{
+ return 0;
+}
+
#endif /* PT_GET_PROCESS_STATE */
\f
target_mourn_inferior ();
}
-/* Stop the inferior. */
+/* Interrupt the inferior. */
static void
-inf_ptrace_stop (struct target_ops *self, ptid_t ptid)
+inf_ptrace_interrupt (struct target_ops *self, ptid_t ptid)
{
/* Send a SIGINT to the process group. This acts just like the user
typed a ^C on the controlling terminal. Note that using a
/* Return which PID to pass to ptrace in order to observe/control the
tracee identified by PTID. */
-static pid_t
+pid_t
get_ptrace_pid (ptid_t ptid)
{
pid_t pid;
ptid_t ptid, int step, enum gdb_signal signal)
{
pid_t pid;
-
int request;
if (ptid_equal (minus_one_ptid, ptid))
/* Resume all threads. Traditionally ptrace() only supports
single-threaded processes, so simply resume the inferior. */
- pid = get_ptrace_pid (inferior_ptid);
+ pid = ptid_get_pid (inferior_ptid);
else
pid = get_ptrace_pid (ptid);
t->to_create_inferior = inf_ptrace_create_inferior;
#ifdef PT_GET_PROCESS_STATE
t->to_follow_fork = inf_ptrace_follow_fork;
+ t->to_insert_fork_catchpoint = inf_ptrace_insert_fork_catchpoint;
+ t->to_remove_fork_catchpoint = inf_ptrace_remove_fork_catchpoint;
t->to_post_startup_inferior = inf_ptrace_post_startup_inferior;
t->to_post_attach = inf_ptrace_post_attach;
#endif
t->to_mourn_inferior = inf_ptrace_mourn_inferior;
t->to_thread_alive = inf_ptrace_thread_alive;
t->to_pid_to_str = inf_ptrace_pid_to_str;
- t->to_stop = inf_ptrace_stop;
+ t->to_interrupt = inf_ptrace_interrupt;
t->to_xfer_partial = inf_ptrace_xfer_partial;
#if defined (PT_IO) && defined (PIOD_READ_AUXV)
t->to_auxv_parse = inf_ptrace_auxv_parse;
size = register_size (gdbarch, regnum);
gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0);
- buf = alloca (size);
+ buf = (PTRACE_TYPE_RET *) alloca (size);
/* Read the register contents from the inferior a chunk at a time. */
for (i = 0; i < size / sizeof (PTRACE_TYPE_RET); i++)
size = register_size (gdbarch, regnum);
gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0);
- buf = alloca (size);
+ buf = (PTRACE_TYPE_RET *) alloca (size);
/* Write the register contents into the inferior a chunk at a time. */
regcache_raw_collect (regcache, regnum, buf);