how to set commandline args in gdb remote debug?

zhu yong
Thu Dec 16 00:59:00 GMT 2004

I want to debug my application (hciattach) in gdb remote debug.
host use arm-elf-gdb and target use gdbserver.
normally, my application need commandline args as follows:
hciattach /dev/ttyS0 bcsp 115200

So I invoke gdb like this:
arm-elf-gdb --args hciattach.gdb /dev/ttyS0 bcsp 115200
hciattach.gdb include debug info.
during debug, I print argc's value:
is it error?
I also try
"arm-elf-gdb hciattach.gdb"
"target remote"
"set args hciattach /dev/ttyS0 bcsp 115200"
"b main"
but *argc still equal "-1".

how can i set commandline args in gdb remote debug? any advice will help me.

best regards
yong zhu

More information about the Gdb mailing list