PR symtab/19914 fix handling of dwp + split debug
[deliverable/binutils-gdb.git] / gdb / fork-child.c
index 4c316b1736cef035caa5e6e3f4f88445a3f8601e..204b7cf99157393b6cfa2d3e028222c691b093bf 100644 (file)
@@ -1,6 +1,6 @@
 /* Fork a Unix child process, and set up to debug it, for GDB.
 
-   Copyright (C) 1990-2014 Free Software Foundation, Inc.
+   Copyright (C) 1990-2016 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
 
@@ -170,7 +170,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
         argument.  */
       int argc = (strlen (allargs) + 1) / 2 + 2;
 
-      argv = (char **) alloca (argc * sizeof (*argv));
+      argv = XALLOCAVEC (char *, argc);
       argv[0] = exec_file;
       breakup_args (allargs, &argv[1]);
     }
@@ -365,7 +365,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 
       /* If we get here, it's an error.  */
       save_errno = errno;
-      fprintf_unfiltered (gdb_stderr, "Cannot exec %s", exec_file);
+      fprintf_unfiltered (gdb_stderr, "Cannot exec %s", argv[0]);
       for (i = 1; argv[i] != NULL; i++)
        fprintf_unfiltered (gdb_stderr, " %s", argv[i]);
       fprintf_unfiltered (gdb_stderr, ".\n");
This page took 0.023837 seconds and 4 git commands to generate.