This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Adjust gdbserver execv behavior


Gdbserver used to use execv; Mike Frysinger suggested we change it to
execvp.  I went ahead and applied that but I should have thought about
it a bit more since it fried my test harness :-)

It's friendlier in this context to prefer $PWD, since that's what
we've always done before.  Checked in.

-- 
Daniel Jacobowitz
CodeSourcery

2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>

	gdb/gdbserver/
	* linux-low.c (linux_create_inferior): Try execv before execvp.
	* spu-low.c (spu_create_inferior): Likewise.

Index: gdb/gdbserver/linux-low.c
===================================================================
--- gdb/gdbserver/linux-low.c	(revision 174588)
+++ gdb/gdbserver/linux-low.c	(working copy)
@@ -165,7 +165,9 @@ linux_create_inferior (char *program, ch
 
       setpgid (0, 0);
 
-      execvp (program, allargs);
+      execv (program, allargs);
+      if (errno == ENOENT)
+	execvp (program, allargs);
 
       fprintf (stderr, "Cannot exec %s: %s.\n", program,
 	       strerror (errno));
Index: gdb/gdbserver/spu-low.c
===================================================================
--- gdb/gdbserver/spu-low.c	(revision 174588)
+++ gdb/gdbserver/spu-low.c	(working copy)
@@ -278,7 +278,9 @@ spu_create_inferior (char *program, char
 
       setpgid (0, 0);
 
-      execvp (program, allargs);
+      execv (program, allargs);
+      if (errno == ENOENT)
+	execvp (program, allargs);
 
       fprintf (stderr, "Cannot exec %s: %s.\n", program,
 	       strerror (errno));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]