Is it possible for Eclipse to read stdin from a file?
The solution for me (running on a Mac, using Eclipse CDT for a C application) was to add "< path/to/somefile" at the end of other arguments in the "Arguments" tab of the "Run Configuration" dialog.
Also check this other question for an answer involving launching a Java program in a suspended state and then attaching the debugger using Eclipse.