can't handle command-line argument containing whitespace

Eli Zaretskii
Mon Jan 21 15:49:00 GMT 2019

> From: Peng Yu <>
> Date: Mon, 21 Jan 2019 07:16:41 -0600
> Cc: "" <>
> > 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.)

More information about the Gdb mailing list