[RFA/commit/Windows] run program with space in path to exe.
Joel Brobecker
brobecker@adacore.com
Sat Oct 20 16:30:00 GMT 2012
> Does it work if you say
>
> % gdb "\"c:\path to exe\foo.exe\""
>
> instead?
It doesn't, because GDB thinks that the name of the executable includes
those quotes.
> This is impossible, at least in the MinGW case: Windows file names
> cannot include the quote character. See
>
> http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
OK, great. I wasn't sure whether this was allowed or not. I was able
to create a file with a double-quote, but that was under cygwin.
> But what happens if the program name is already quoted? A user can do
> that if she realizes the problem in advance, certainly if the program
> name is specified at the GDB prompt, as in 'file "c:\foo bar\my.exe"'.
> I think we should detect this case and not quote it again.
As per the above - this time, it's GDB that punts, so we never even
get to the point where we can run the program.
> Also, what about the arguments to the program? Don't they have the
> same issue when you use --args on the GDB command line?
The arguments are always quoted properly by the generic portion of
GDB. No problem there.
--
Joel
More information about the Gdb-patches
mailing list