/* Darwin support for GDB, the GNU debugger.
- Copyright (C) 2008-2017 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
Contributed by AdaCore.
#define PTRACE(CMD, PID, ADDR, SIG) \
darwin_ptrace(#CMD, CMD, (PID), (ADDR), (SIG))
-static void darwin_interrupt (struct target_ops *self, ptid_t);
+static void darwin_interrupt (struct target_ops *self);
static void darwin_resume_to (struct target_ops *ops, ptid_t ptid, int step,
enum gdb_signal signal);
if (new_ix < new_nbr && (old_ix == old_nbr || new_id < old_id))
{
/* A thread was created. */
- struct private_thread_info *pti;
+ darwin_thread_info *pti = new darwin_thread_info;
- pti = XCNEW (darwin_thread_t);
pti->gdb_port = new_id;
pti->msg_state = DARWIN_RUNNING;
}
static void
-darwin_interrupt (struct target_ops *self, ptid_t t)
+darwin_interrupt (struct target_ops *self)
{
struct inferior *inf = current_inferior ();
darwin_inferior *priv = get_darwin_inferior (inf);
push_target (darwin_ops);
}
-/* Get the thread_info object corresponding to this private_thread_info. */
+/* Get the thread_info object corresponding to this darwin_thread_info. */
static struct thread_info *
-thread_info_from_private_thread_info (private_thread_info *pti)
+thread_info_from_private_thread_info (darwin_thread_info *pti)
{
struct thread_info *it;
ALL_THREADS (it)
{
- if (it->priv->gdb_port == pti->gdb_port)
+ darwin_thread_info *iter_pti = get_darwin_thread_info (it);
+
+ if (iter_pti->gdb_port == pti->gdb_port)
break;
}
gdb_assert (!priv->threads.empty ());
- private_thread_info *first_pti = priv->threads.front ();
+ darwin_thread_info *first_pti = priv->threads.front ();
struct thread_info *first_thread
= thread_info_from_private_thread_info (first_pti);
previously attached. It *might* work if the program was
started via fork. */
static void
-darwin_detach (struct target_ops *ops, const char *args, int from_tty)
+darwin_detach (struct target_ops *ops, inferior *inf, int from_tty)
{
pid_t pid = ptid_get_pid (inferior_ptid);
- struct inferior *inf = current_inferior ();
darwin_inferior *priv = get_darwin_inferior (inf);
kern_return_t kret;
int res;