I have a program that takes input from stdin and also takes some parameters from command line. It looks like this:
cat input.txt > mypr
There are several ways to do it:
$ gdb myprogram
(gdb) r -path /home/user/work < input.txt
or
$ gdb myprogram
(gdb) set args -path /home/user/work < input.txt
(gdb) r
or
$ gdb -ex 'set args -path /home/user/work < input.txt' myprogram
(gdb) r
where the gdb run command (r) uses by default the arguments as set previously with set args.