I’d like to ask how to debug some program using gdb that reads from stdin.
g++ -Wall test.c -o test
and I’m running it as
./test < test.in
I tried to debug it in gdb (none of those two tries worked)
gdb test < test.in
or (inspiration http://www.velocityreviews.com/forums/t645602-using-gbd-to-debug-a-program-reading-from-stdin.html, http://stackoverflow.com/questions/2953658/gdb-trouble-with-stdin-redirection)
gdb test
and in gdb
(gdb) run < test.in
but I’m getting
Starting program: < test.in
No executable file specified.
Use the "file" or "exec-file" command.
Any idea what am I doing wrong?