can't handle command-line argument containing whitespace

Eli Zaretskii eliz@gnu.org
Mon Jan 21 15:49:00 GMT 2019


> From: Peng Yu <pengyu.ut@gmail.com>
> Date: Mon, 21 Jan 2019 07:16:41 -0600
> Cc: "gdb@sourceware.org" <gdb@sourceware.org>
> 
> > 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