Move gdbserver tdesc header funcs to c file
[deliverable/binutils-gdb.git] / gdb / darwin-nat.c
index ed195d910c7e818dbbfc548e0ef88b78a51cb984..e98ac6c5486f5527a847467161fa93bfdbb49997 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
 
@@ -83,7 +83,7 @@
 #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);
@@ -363,9 +363,8 @@ darwin_check_new_threads (struct inferior *inf)
       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;
 
@@ -1343,7 +1342,7 @@ darwin_wait_to (struct target_ops *ops,
 }
 
 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);
@@ -1692,16 +1691,18 @@ darwin_attach_pid (struct 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;
     }
 
@@ -1719,7 +1720,7 @@ darwin_init_thread_list (struct inferior *inf)
 
   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);
 
@@ -1937,10 +1938,9 @@ darwin_attach (struct target_ops *ops, const char *args, int from_tty)
    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;
This page took 0.024839 seconds and 4 git commands to generate.