Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 251
user1069609 Avatar asked Jan 13 '12 14:01

user1069609


1 Answers

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

like image 142
Yodo Avatar answered Oct 19 '22 09:10

Yodo