This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix program invocation by gdbserver on MS-Windows
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 14 Feb 2020 11:56:09 +0200
- Subject: Re: [PATCH] Fix program invocation by gdbserver on MS-Windows
- References: <83y2v1vd0i.fsf@gnu.org> <20200213063423.17c7de33@f31-4.lan>
> Date: Thu, 13 Feb 2020 06:34:23 -0700
> From: Kevin Buettner <kevinb@redhat.com>
> Cc: Eli Zaretskii <eliz@gnu.org>
>
> On Tue, 24 Dec 2019 19:39:41 +0200
> Eli Zaretskii <eliz@gnu.org> wrote:
>
> > gdbserver doesn't construct the command-line correctly when it invokes
> > programs on MS-Windows. For example, if you invoke
> >
> > gdbserver :9999 etags.exe --help
> >
> > and then connect from GDB and run the inferior, you will see:
> >
> > Remote debugging from host 127.0.0.1, port 3546
> > --help: no input files specified.
> > Try '--help --help' for a complete list of options.
> >
> > Child exited with status 1
> >
> > Which means that (a) the program exited abnormally; and (b) it
> > received "--help" in argv[0].
> >
> > This is because the way we construct the command line in win32-low.c
> > is incorrect: we should prepend the program's name to the arguments.
> >
> > The patch below does that. OK to commit it?
> >
> > diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
> > index 028d1e9..29de8b6 100644
> > --- a/gdb/gdbserver/ChangeLog
> > +++ b/gdb/gdbserver/ChangeLog
> > @@ -1,3 +1,10 @@
> > +2019-12-24 Eli Zaretskii <eliz@gnu.org>
> > +
> > + * win32-low.c (create_process): Prepend PROGRAM to ARGS when
> > + preparing the command line for CreateProcess.
> > + (win32_create_inferior): Reflect the program name in debugging
> > + output that shows the process and its command line.
> > +
>
> LGTM.
Thanks, pushed to the master branch.