在Linux上,在Eclipse CDT中使用gdb调试C++应用程序,如何向stdin输入内容?

use*_*609 7 c++ eclipse stdin gdb eclipse-cdt

在Linux上,我试图在Eclipse CDT中使用gdb调试C++应用程序.

例如,应用程序applic.exe需要一些命令行参数arg1,arg2并且它需要一些数据stdin(例如,从文件中获取input.txt).

通常,要在控制台中运行应用程序,我会这样做:

cat input.txt | applic.exe arg1 arg2
Run Code Online (Sandbox Code Playgroud)

在控制台中使用gdb我可以这样做:

gdb applic.exe
(gdb) run applic.exe arg1 arg2 < input.txt
Run Code Online (Sandbox Code Playgroud)

在Eclipse中使用gdb可以做到这一点吗?我知道如何在Eclipse Debug Configurations中指定参数(和环境),但是呢stdin

Yod*_*odo 2

Eclipse 中有一个 Console 选项卡(位于 IDE 的底部),您可以将数据放在这里。