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]

Fix target remote pipe error message


I've just run into this:

    (gdb) target remote | foobar
    (gdb) error starting child process ' foobar': 
          CreateProcess: No such file or directory

Note the leading space before 'foobar' in the error message. That might 
suggest that space between "|" and program name is the problem while it's 
not.

This patch fixes the error message. OK?

- Volodya

	* serial.c (serial_open): Strip leading spaces from program name
	when opening pipe.



Index: serial.c
===================================================================
RCS file: /cvs/src/src/gdb/serial.c,v
retrieving revision 1.26
diff -u -r1.26 serial.c
--- serial.c	24 Apr 2006 21:00:13 -0000	1.26
+++ serial.c	3 Nov 2006 15:30:16 -0000
@@ -189,7 +189,10 @@
   else if (strncmp (name, "|", 1) == 0)
     {
       ops = serial_interface_lookup ("pipe");
-      open_name = name + 1; /* discard ``|'' */
+      /* discard ``|'' and any space before the command itself. */
+      ++open_name;
+      while (isspace (*open_name))
+	++open_name;
     }
   /* Check for a colon, suggesting an IP address/port pair.
      Do this *after* checking for all the interesting prefixes.  We

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