btrace, gdbserver: remove the to_supports_btrace target method
[deliverable/binutils-gdb.git] / gdb / gdbserver / nto-low.c
index ee043b12083000167644d0f0845e9006468625d9..b68b8111592c667a78d98038335905c45c5f5d9c 100644 (file)
@@ -1,6 +1,6 @@
 /* QNX Neutrino specific low level interface, for the remote server
    for GDB.
-   Copyright (C) 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2009-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -347,14 +347,17 @@ nto_read_auxv_from_initial_stack (CORE_ADDR initial_stack,
   return len_read;
 }
 
-/* Start inferior specified by PROGRAM passing arguments ALLARGS.  */
+/* Start inferior specified by PROGRAM, using PROGRAM_ARGS as its
+   arguments.  */
 
 static int
-nto_create_inferior (char *program, char **allargs)
+nto_create_inferior (const char *program,
+                    const std::vector<char *> &program_args)
 {
   struct inheritance inherit;
   pid_t pid;
   sigset_t set;
+  std::string str_program_args = stringify_argv (program_args);
 
   TRACE ("%s %s\n", __func__, program);
   /* Clear any pending SIGUSR1's but keep the behavior the same.  */
@@ -367,7 +370,8 @@ nto_create_inferior (char *program, char **allargs)
   memset (&inherit, 0, sizeof (inherit));
   inherit.flags |= SPAWN_SETGROUP | SPAWN_HOLD;
   inherit.pgroup = SPAWN_NEWPGROUP;
-  pid = spawnp (program, 0, NULL, &inherit, allargs, 0);
+  pid = spawnp (program, 0, NULL, &inherit,
+               (char *) str_program_args.c_str (), 0);
   sigprocmask (SIG_BLOCK, &set, NULL);
 
   if (pid == -1)
@@ -616,7 +620,6 @@ nto_fetch_registers (struct regcache *regcache, int regno)
 {
   int regsize;
   procfs_greg greg;
-  ptid_t ptid;
 
   TRACE ("%s (regno=%d)\n", __func__, regno);
   if (regno >= the_low_target.num_regs)
@@ -627,7 +630,7 @@ nto_fetch_registers (struct regcache *regcache, int regno)
       TRACE ("current_thread is NULL\n");
       return;
     }
-  ptid = thread_to_gdb_id (current_thread);
+  ptid_t ptid = ptid_of (current_thread);
   if (!nto_set_thread (ptid))
     return;
 
@@ -665,7 +668,6 @@ nto_store_registers (struct regcache *regcache, int regno)
 {
   procfs_greg greg;
   int err;
-  ptid_t ptid;
 
   TRACE ("%s (regno:%d)\n", __func__, regno);
 
@@ -674,7 +676,7 @@ nto_store_registers (struct regcache *regcache, int regno)
       TRACE ("current_thread is NULL\n");
       return;
     }
-  ptid = thread_to_gdb_id (current_thread);
+  ptid_t ptid = ptid_of (current_thread);
   if (!nto_set_thread (ptid))
     return;
 
@@ -863,9 +865,7 @@ nto_stopped_by_watchpoint (void)
   TRACE ("%s\n", __func__);
   if (nto_inferior.ctl_fd != -1 && current_thread != NULL)
     {
-      ptid_t ptid;
-
-      ptid = thread_to_gdb_id (current_thread);
+      ptid_t ptid = ptid_of (current_thread);
       if (nto_set_thread (ptid))
        {
          const int watchmask = _DEBUG_FLAG_TRACE_RD | _DEBUG_FLAG_TRACE_WR
@@ -895,9 +895,7 @@ nto_stopped_data_address (void)
   TRACE ("%s\n", __func__);
   if (nto_inferior.ctl_fd != -1 && current_thread != NULL)
     {
-      ptid_t ptid;
-
-      ptid = thread_to_gdb_id (current_thread);
+      ptid_t ptid = ptid_of (current_thread);
 
       if (nto_set_thread (ptid))
        {
@@ -993,7 +991,6 @@ static struct target_ops nto_target_ops = {
   NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* qxfer_libraries_svr4 */
   NULL, /* support_agent */
-  NULL, /* support_btrace */
   NULL, /* enable_btrace */
   NULL, /* disable_btrace */
   NULL, /* read_btrace */
This page took 0.028595 seconds and 4 git commands to generate.