Use construct_inferior_arguments which handles special chars
[deliverable/binutils-gdb.git] / gdbserver / server.cc
index 77175ff74cb3e1b698e8fb1922859568de71e6d1..0313d18bb24720c2f8c07046715f19a988540f8e 100644 (file)
@@ -1103,7 +1103,7 @@ handle_search_memory_1 (CORE_ADDR start_addr, CORE_ADDR search_space_len,
                        : chunk_size);
 
          if (gdb_read_memory (read_addr, search_buf + keep_len,
-                              nr_to_read) != search_buf_size)
+                              nr_to_read) != nr_to_read)
            {
              warning ("Unable to access %ld bytes of target memory "
                       "at 0x%lx, halting search.",
@@ -2957,7 +2957,7 @@ handle_v_run (char *own_buf)
       else if (p == next_p)
        {
          /* Empty argument.  */
-         new_argv.push_back (xstrdup ("''"));
+         new_argv.push_back (xstrdup (""));
        }
       else
        {
@@ -3015,7 +3015,6 @@ handle_v_run (char *own_buf)
       if (*next_p)
        next_p++;
     }
-  new_argv.push_back (NULL);
 
   if (new_program_name == NULL)
     {
@@ -3815,7 +3814,6 @@ captured_main (int argc, char *argv[])
       program_path.set (make_unique_xstrdup (next_arg[0]));
       for (i = 1; i < n; i++)
        program_args.push_back (xstrdup (next_arg[i]));
-      program_args.push_back (NULL);
 
       /* Wait till we are at first instruction in program.  */
       target_create_inferior (program_path.get (), program_args);
This page took 0.047291 seconds and 4 git commands to generate.