Search code examples
c++eclipsegdbstdineclipse-cdt

On Linux, Debugging a C++ application with gdb in Eclipse CDT, how to input something to stdin?


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?


Solution

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