This is the mail archive of the
mailing list for the GDB project.
Re: can't handle command-line argument containing whitespace
> From: Peng Yu <email@example.com>
> Date: Mon, 21 Jan 2019 07:16:41 -0600
> Cc: "firstname.lastname@example.org" <email@example.com>
> > Try this GDB command:
> > (gdb) set startup-with-shell on
> But it doesn't work with the -batch option. It hangs there forever.
> How to fix it? Thanks.
Don't run your program from the command line, run it from a script
file that you load via the -x command-line switch. In that script,
put the "set startup-with-shell on" command first, then your "run"
command with the arguments for the program you want to debug.
(Why do you run GDB with -batch, btw? GDB is an interactive debugger,
so you should have a way of interacting with it.)