This is how I do it from the command line:
Code:
$ gdb /path/to/my/program
license and loading info
(gdb) run /path/to/my/inputfile
You can even attach the file to standard input by doing
Code:
(gdb) run < /path/to/my/inputfile
like you normally would from the command line.
If you're using Xcode, you get info on your executable and set the arguments in there.