gas/
[deliverable/binutils-gdb.git] / gdb / darwin-nat.c
index 15a4b55a383ce9dd5522272fe611355701c1f68c..8c20bd905a02d415bc693ceb2d651a0ceb421ab5 100644 (file)
@@ -90,7 +90,7 @@ static void darwin_mourn_inferior (struct target_ops *ops);
 
 static int darwin_lookup_task (char *args, task_t * ptask, int *ppid);
 
-static void darwin_kill_inferior (void);
+static void darwin_kill_inferior (struct target_ops *ops);
 
 static void darwin_ptrace_me (void);
 
@@ -242,7 +242,7 @@ darwin_ptrace (const char *name,
 
   inferior_debug (2, _("ptrace (%s, %d, 0x%x, %d): %d (%s)\n"),
                   name, pid, arg3, arg4, ret,
-                  (ret != 0) ? strerror (errno) : _("no error"));
+                  (ret != 0) ? safe_strerror (errno) : _("no error"));
   return ret;
 }
 
@@ -367,7 +367,7 @@ darwin_resume (struct target_ops *ops,
            {
              int nsignal = target_signal_to_host (signal);
              res = PTRACE (PT_THUPDATE, pid,
-                                  (void *)exc_msg.thread_port, nsignal);
+                           (void *)(uintptr_t)exc_msg.thread_port, nsignal);
              if (res < 0)
                printf_unfiltered (_("ptrace THUP: res=%d\n"), res);
            }
@@ -476,7 +476,7 @@ catch_exception_raise (mach_port_t port,
 
 static ptid_t
 darwin_wait (struct target_ops *ops,
-            ptid_t ptid, struct target_waitstatus *status)
+            ptid_t ptid, struct target_waitstatus *status, int options)
 {
   kern_return_t kret;
   mach_msg_header_t *hdr = &msgin.hdr;
@@ -668,7 +668,7 @@ darwin_mourn_inferior (struct target_ops *ops)
 }
 
 static void
-darwin_stop_inferior (darwin_inferior *inf)
+darwin_stop_inferior (struct target_ops *ops, darwin_inferior *inf)
 {
   struct target_waitstatus wstatus;
   ptid_t ptid;
@@ -686,9 +686,9 @@ darwin_stop_inferior (darwin_inferior *inf)
 
   res = kill (inf->pid, SIGSTOP);
   if (res != 0)
-    warning (_("cannot kill: %s\n"), strerror (errno));
+    warning (_("cannot kill: %s\n"), safe_strerror (errno));
 
-  ptid = darwin_wait (inferior_ptid, &wstatus);
+  ptid = darwin_wait (ops, inferior_ptid, &wstatus);
   gdb_assert (wstatus.kind = TARGET_WAITKIND_STOPPED);
 }
 
@@ -706,7 +706,7 @@ darwin_kill_inferior (struct target_ops *ops)
   if (ptid_equal (inferior_ptid, null_ptid))
     return;
 
-  darwin_stop_inferior (darwin_inf);
+  darwin_stop_inferior (ops, darwin_inf);
 
   res = PTRACE (PT_KILL, darwin_inf->pid, 0, 0);
   gdb_assert (res == 0);
@@ -720,7 +720,7 @@ darwin_kill_inferior (struct target_ops *ops)
   kret = task_resume (darwin_inf->task);
   MACH_CHECK_ERROR (kret);
 
-  ptid = darwin_wait (inferior_ptid, &wstatus);
+  ptid = darwin_wait (ops, inferior_ptid, &wstatus);
 
   /* This double wait seems required...  */
   res = waitpid (darwin_inf->pid, &status, 0);
@@ -964,7 +964,7 @@ darwin_attach (struct target_ops *ops, char *args, int from_tty)
   res = PTRACE (PT_ATTACHEXC, pid, 0, 0);
   if (res != 0)
     error (_("Unable to attach to process-id %d: %s (%d)"),
-          pid, strerror (errno), errno);
+          pid, safe_strerror (errno), errno);
 
   inf = add_inferior (pid);
   inf->attach_flag = 1;
@@ -1011,7 +1011,7 @@ darwin_detach (struct target_ops *ops, char *args, int from_tty)
       gdb_flush (gdb_stdout);
     }
 
-  darwin_stop_inferior (darwin_inf);
+  darwin_stop_inferior (ops, darwin_inf);
 
   kret = darwin_restore_exception_ports (darwin_inf);
   MACH_CHECK_ERROR (kret);
@@ -1028,7 +1028,7 @@ darwin_detach (struct target_ops *ops, char *args, int from_tty)
   res = PTRACE (PT_DETACH, darwin_inf->pid, 0, 0);
   if (res != 0)
     printf_unfiltered (_("Unable to detach from process-id %d: %s (%d)"),
-                      darwin_inf->pid, strerror (errno), errno);
+                      darwin_inf->pid, safe_strerror (errno), errno);
 
   msg_state = NO_MESSAGE;
 
@@ -1197,8 +1197,10 @@ darwin_xfer_partial (struct target_ops *ops,
                     gdb_byte *readbuf, const gdb_byte *writebuf,
                     ULONGEST offset, LONGEST len)
 {
-  inferior_debug (8, _("darwin_xfer_partial(%s, %d, rbuf=%p, wbuf=%p)\n"),
-                 core_addr_to_string (offset), (int)len, readbuf, writebuf);
+  inferior_debug (8, _("darwin_xfer_partial(%s, %d, rbuf=%s, wbuf=%s)\n"),
+                 core_addr_to_string (offset), (int)len, 
+                 host_address_to_string (readbuf),
+                 host_address_to_string (writebuf));
 
   if (object != TARGET_OBJECT_MEMORY)
     return -1;
This page took 0.0254 seconds and 4 git commands to generate.