If the --args
parameter is not working on your machine (i.e. on Solaris 8), you may start gdb like
gdb -ex "set args <arg 1> <arg 2> ... <arg n>"
And you can combine this with inputting a file to stdin and "running immediatelly":
gdb -ex "set args <arg 1> <arg 2> ... <arg n> < <input file>" -ex "r"