如何在 Eclipse CDT 中使用 GDB 控制台?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3387587/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use the GDB console in Eclipse CDT?
提问by Nils
Is there a way how I can access gdb's console in Eclipse? I would like to just be able to set breakpoints with the mouse and then use the console for debugging.
有没有办法在 Eclipse 中访问 gdb 的控制台?我只想能够用鼠标设置断点,然后使用控制台进行调试。
回答by Dawid Drozd
You must click here
你必须点击这里
Next select one with *gdb
接下来选择一个*gdb
Now you can write GDB commands in console example:
现在您可以在控制台示例中编写 GDB 命令:
回答by Huang Dongsung
First of all, you need to install CDT plugin. Then, you can debug C++ application like Java application in Eclipse.
首先,您需要安装CDT插件。然后,您可以像在 Eclipse 中调试 Java 应用程序一样调试 C++ 应用程序。
If you want gdb console, push 'Display Selected Console' in Console view in Debug perspective.
如果您需要 gdb 控制台,请在调试透视图的控制台视图中推送“显示选定的控制台”。
You can choose '[Your App name][C/C++ Application]gdb' entry, and then you can type gdb instruction(i.e. print this) in Console View.
您可以选择“[您的应用程序名称][C/C++ 应用程序]gdb”条目,然后您可以在控制台视图中键入 gdb 指令(即打印此)。
回答by IanH
It is possible to write in the console window and gdb answers. (You have to choose the right console window from the chooser in the top right edge of the console view).
可以在控制台窗口和 gdb 答案中写入。(您必须从控制台视图右上角的选择器中选择正确的控制台窗口)。
Unfortunately the console is quite limited: gdb answers to command, but important features like tab-completion do not work.
不幸的是,控制台非常有限:gdb 会响应命令,但诸如制表符完成之类的重要功能不起作用。