Fix target remote pipe command for MinGW

Message ID AM0PR01MB58445D93A19496D0404E195BDAE89@AM0PR01MB5844.eurprd01.prod.exchangelabs.com
State New
Headers
Series Fix target remote pipe command for MinGW |

Commit Message

Jonas Hoerberg Dec. 22, 2022, 3:22 p.m. UTC
  The cced7cacecad104fff0 ("gdb: preserve `|` in connection details string")
commit added '|' detection and removal to ser-pipe.c, but missed to add it
to ser-mingw.c.

This results in the error message below for MinGW hosts:
error starting child process '| <executable> <args>': CreateProcess: No such file or directory

This commit add the missing '|' detection and removal to ser-mingw.c.
---
 gdb/ser-mingw.c | 6 ++++++
 1 file changed, 6 insertions(+)

--
2.39.0.windows.1


Classified as Business
  

Comments

Tom Tromey Jan. 2, 2023, 3:10 p.m. UTC | #1
>>>>> "Jonas" == Jonas Hoerberg via Gdb-patches <gdb-patches@sourceware.org> writes:

Jonas> The cced7cacecad104fff0 ("gdb: preserve `|` in connection details string")
Jonas> commit added '|' detection and removal to ser-pipe.c, but missed to add it
Jonas> to ser-mingw.c.

Jonas> This results in the error message below for MinGW hosts:
Jonas> error starting child process '| <executable> <args>': CreateProcess: No such file or directory

Jonas> This commit add the missing '|' detection and removal to ser-mingw.c.

Thank you for the patch.  I'm going to push it now and also apply it to
the gdb 13 branch.

If you plan to write more patches for gdb, contact me off-list and we
can get the copyright assignment paperwork started.

thanks,
Tom
  

Patch

diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c
index a62502b8d54..94b4d0df5da 100644
--- a/gdb/ser-mingw.c
+++ b/gdb/ser-mingw.c
@@ -867,6 +867,12 @@  pipe_windows_open (struct serial *scb, const char *name)
   if (name == NULL)
     error_no_arg (_("child command"));

+  if (*name == '|')
+    {
+      name++;
+      name = skip_spaces (name);
+    }
+
   gdb_argv argv (name);

   if (! argv[0] || argv[0][0] == '\0')