I'm trying to debug a program using gdb mode in emacs. It was compiled with g++, and I'm using cygwin. My program takes one command line argument, and also takes input from stdin, which I redirect from a file, like this:
program.exe inputFile.dat <otherInput.dat
The problem is, gdb is sending the string
"<otherInput.dat"
as a command line argument instead of redirecting stdin. How do I force gdb to redirect stdin?
EDIT:
Within gdb, I'm using the command:
run inputFile.dat <otherInput.dat
It doesn't work when I use gdb outside of emacs, either.
EDIT #2:
dfa pointed out a similar question: http://stackoverflow.com/questions/455544/how-to-load-program-reading-stdin-and-taking-parameters-in-gdb
Unfortunately, the accepted answer for that question isn't working for me... Could it be a cygwin-related bug?