This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: can't handle command-line argument containing whitespace
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb at sourceware dot org,Peng Yu <pengyu dot ut at gmail dot com>,"gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Mon, 21 Jan 2019 12:19:21 +0200
- Subject: Re: can't handle command-line argument containing whitespace
- References: <CABrM6wmBb3CfAAjw4adQV7ebATb+ybZK0TUOp0rHQPnP1C+p2g@mail.gmail.com>
On January 21, 2019 6:50:25 AM GMT+02:00, Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> I got the following error. Is there a way to allow gdb accept
> arguments with whitespaces? Thanks
>
> $ ./main.exe 'a b c'
> a b c
> $ cat main.c
> /* vim: set noexpandtab tabstop=2: */
> #include <stdio.h>
>
> int main(int argc, char *argv[]) {
> puts(argv[1]);
> return 0;
> }
> $ gdb -q --args main.exe 'a b c'
> Reading symbols from main.exe...(no debugging symbols found)...done.
> (gdb) r
> Starting program: /root/linux/test/gnu/gdb/bin/--args/main.exe can't
> handle command-line argument containing whitespace
> (gdb)
Try this GDB command:
(gdb) set startup-with-shell on