使用 Eclipse CDT 调试 ncurses

发布于 2024-09-27 09:21:18 字数 299 浏览 1 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暮年慕年 2024-10-04 09:21:18

您还应该将 TERM=xterm 添加到“调试配置”对话框中的“环境”

also you should add TERM=xterm to Environment in the Debug Configurations dialog

鹿! 2024-10-04 09:21:18

在使用 Windows 和 mingw 的 pdcurses 运行程序时,我也遇到了调试问题。
上面的 TERM = xterm 解决方案对我来说不起作用,它可能是需要的,但我必须将 Eclipse 设置为使用外部控制台(“...用于劣等”)

Project -> Debug Configurations -> C/C++ Application -> [application name]
Tab: Debugger -> Main

最底部的复选框“使用外部控制台进行劣等(打开一个新的控制台窗口进行输入/输出)”

由于我没有更改上述解决方案(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")

Project -> Debug Configurations -> C/C++ Application -> [application name]
Tab: Debugger -> Main

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文