使用 Eclipse CDT 调试 ncurses
我正在 Eclipse CDT 中使用 ncurses 编写一个 C++ 应用程序,但是我无法在 Eclipse 中运行/调试我的应用程序,因为 Eclipse 中的控制台不能使用 Curses。如果我从终端运行我的应用程序,它运行得很好,但我刚刚添加了一些新代码,现在我遇到了分段错误,所以我想使用 eclipse 中的调试器来帮助我解决问题。有没有办法让 Eclipse 运行/调试我的应用程序,但使用不同的终端来输出,就像在 gdb 中执行“tty /dev/pts/1”时一样?或者在 eclipse 中调试 ncures 应用程序的任何其他方法?
提前谢谢!
I'm writing a C++ application using ncurses in Eclipse CDT however I can't run/debug my app in eclipse because the console in eclipse does not work with curses. My app runs fine if I run it from a terminal but I just added some new code and now I'm getting a segmentation fault so I'd like to use the debugger in eclipse to help me fix the issue. Is there a way to have eclipse run/debug my application but use a different terminal for the output much like when you do "tty /dev/pts/1" in gdb? Or any other way to debug a ncures application in eclipse?
Thx in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还应该将
TERM=xterm
添加到“调试配置”对话框中的“环境”also you should add
TERM=xterm
to Environment in the Debug Configurations dialog在使用 Windows 和 mingw 的 pdcurses 运行程序时,我也遇到了调试问题。
上面的 TERM = xterm 解决方案对我来说不起作用,它可能是需要的,但我必须将 Eclipse 设置为使用外部控制台(“...用于劣等”)
最底部的复选框“使用外部控制台进行劣等(打开一个新的控制台窗口进行输入/输出)”
由于我没有更改上述解决方案(TERM=xterm),因此可能也需要这样做。
I had debugging problems too when running a program using pdcurses for windows and mingw.
The above solution with TERM = xterm didn't work for me, it might be needed, but I had to set eclipse to use an external console ("...for inferior")
the bottom most checkbox "Use external console for inferior (open a new console window for input/output)"
Since I didn't change the above solution (TERM=xterm), that too might be needed.