7

On Linux, I am trying to debug a C++ application with gdb in Eclipse CDT.

For example the application applic.exe takes some command line arguments arg1 and arg2 and it expects some data on stdin (say, taken from a file input.txt).

Normally, to run the application in the console I would do this:

cat input.txt | applic.exe arg1 arg2

Using gdb in the console I can do:

gdb applic.exe
(gdb) run applic.exe arg1 arg2 < input.txt

Is it possible to do that with gdb in Eclipse? I know how to specify the arguments (and the environment) in the Eclipse Debug Configurations, but what about stdin?

user1069609
  • 863
  • 5
  • 16
  • 30
  • I am not sure if that can be done, in the run configuration there is an option for specifying an output file, but for input it says that it needs to have a console attached. – fortran Jan 13 '12 at 14:44

2 Answers2

2

There is Console tab in Eclipse (at the bottom of IDE) you can put your data here.

Yodo
  • 148
  • 1
  • 5
0

Instead of entering the redirection in the arguments tab, append it to the executable file name in the debug configuration.