can't handle command-line argument containing whitespace

Peng Yu pengyu.ut@gmail.com
Mon Jan 21 04:50:00 GMT 2019


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)

-- 
Regards,
Peng



More information about the Gdb mailing list