Multi-target support
[deliverable/binutils-gdb.git] / gdb / gdbserver / nto-low.c
index 236e555714e34a3bf2db6b844eb2320af6f5b741..b4dea479b9c3a01d8ec08cbe612cff5dd37121dd 100644 (file)
@@ -1,6 +1,6 @@
 /* QNX Neutrino specific low level interface, for the remote server
    for GDB.
-   Copyright (C) 2009-2018 Free Software Foundation, Inc.
+   Copyright (C) 2009-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,6 +22,7 @@
 #include "gdbthread.h"
 #include "nto-low.h"
 #include "hostio.h"
+#include "debug.h"
 
 #include <limits.h>
 #include <fcntl.h>
@@ -32,7 +33,6 @@
 #include <sys/neutrino.h>
 
 
-extern int using_threads;
 int using_threads = 1;
 
 const struct target_desc *nto_tdesc;
@@ -247,7 +247,7 @@ nto_xfer_memory (off_t memaddr, unsigned char *myaddr, int len,
   if (nbytes == 0)
     {
       int e = errno;
-      TRACE ("Error in %s : errno=%d (%s)\n", __func__, e, strerror (e));
+      TRACE ("Error in %s : errno=%d (%s)\n", __func__, e, safe_strerror (e));
     }
   return nbytes;
 }
@@ -397,8 +397,10 @@ nto_attach (unsigned long pid)
 /* Send signal to process PID.  */
 
 static int
-nto_kill (int pid)
+nto_kill (process_info *proc)
 {
+  int pid = proc->pid;
+
   TRACE ("%s %d\n", __func__, pid);
   kill (pid, SIGKILL);
   do_detach ();
@@ -408,9 +410,9 @@ nto_kill (int pid)
 /* Detach from process PID.  */
 
 static int
-nto_detach (int pid)
+nto_detach (process_info *proc)
 {
-  TRACE ("%s %d\n", __func__, pid);
+  TRACE ("%s %d\n", __func__, proc->pid);
   do_detach ();
   return 0;
 }
@@ -503,7 +505,7 @@ nto_resume (struct thread_resume *resume_info, size_t n)
 
   err = devctl (nto_inferior.ctl_fd, DCMD_PROC_RUN, &run, sizeof (run), 0);
   if (err != EOK)
-    TRACE ("Error: %d \"%s\"\n", err, strerror (err));
+    TRACE ("Error: %d \"%s\"\n", err, safe_strerror (err));
 }
 
 /* Wait for inferior's event.  
@@ -929,7 +931,7 @@ nto_sw_breakpoint_from_kind (int kind, int *size)
 }
 
 
-static struct target_ops nto_target_ops = {
+static process_stratum_target nto_target_ops = {
   nto_create_inferior,
   NULL,  /* post_create_inferior */
   nto_attach,
@@ -961,7 +963,6 @@ static struct target_ops nto_target_ops = {
   nto_stopped_data_address,
   NULL, /* nto_read_offsets */
   NULL, /* thread_db_set_tls_address */
-  NULL,
   hostio_last_error_from_errno,
   NULL, /* nto_qxfer_osdata */
   NULL, /* xfer_siginfo */
This page took 0.026615 seconds and 4 git commands to generate.