如何将 GDB 调试器安装到 Eclipse CDT
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4544711/
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 install GDB debugger to Eclipse CDT
提问by parsifal
I want to use Integrated Tool to develop C++, not to use Eclipse as only the editor and compile in other environment. my eclipse CDT tool as default is without GDB debugging environment, can any body give some hints on how to install gdb to Eclipse CDT?
我想用Integrated Tool 来开发C++,而不是用Eclipse 作为唯一的编辑器,在其他环境下编译。我的 eclipse CDT 工具默认没有 GDB 调试环境,任何机构都可以提供一些有关如何将 gdb 安装到 Eclipse CDT 的提示吗?
回答by SChepurin
For Windows - You can find "ready to use" gdb.exe here MinGW - Minimalist GNU for Windows at Sourceforge.net. Get gdb-7.0-2-mingw32-bin.tar.gz.
对于 Windows - 您可以在此处找到“准备使用”gdb.exe MinGW -Sourceforge.net 上的Minimalist GNU for Windows。获取 gdb-7.0-2-mingw32-bin.tar.gz。
Just install into MinGW directory and set path to gdb.exe under Run->Debug Configurations->Debugger.
只需安装到 MinGW 目录并在Run->Debug Configurations->Debugger下设置 gdb.exe 的路径。
The latest on 05.2012 - MinGW - Minimalist GNU for Windows - gdb-7.4-2-mingw32-bin.tar.lzma
2012 年 5 月 5 日的最新消息 - MinGW - Windows 的极简主义 GNU- gdb-7.4-2-mingw32-bin.tar.lzma
回答by parsifal
Eclipse is big on modularization...unlike other IDE's you are responsible for installing the needed "modules". For example, my installation came with the base and CDT (C++ Development Tools) but no debugger. Seems a bit absurd to have and IDE w/ out a default debugger but so it goes.
Eclipse 在模块化方面很重要……与其他 IDE 不同,您负责安装所需的“模块”。例如,我的安装带有基础和 CDT(C++ 开发工具),但没有调试器。拥有带有默认调试器的 IDE 似乎有点荒谬,但事实就是如此。
For my installation I had to install Eclipse and than install GDB ( A Debugger) and then tell Eclipse where the debugger is by setting the path variable to the debugger.
对于我的安装,我必须先安装 Eclipse,然后再安装 GDB(一个调试器),然后通过将路径变量设置为调试器来告诉 Eclipse 调试器的位置。
This link is a bit outdated but it is the best I could find. It uses the GDB (GNU Debugger) that comes with MinGW (Minimalist GNU for Windows).
这个链接有点过时,但它是我能找到的最好的。它使用 MinGW (Minimalist GNU for Windows) 附带的 GDB (GNU Debugger)。
回答by Kane
回答by Darren Evans
I ran into issues with gdb as supplied in the official MinGW distribution on Sourceforge. As far as I can tell, that gdb.exe is configured as mingw32 and it didn't work for 64bit applications. I'm also not sure how you go about building gdb yourself from the source files at the official website. Someone more experienced than I might be able to link in some information about this so that you can build your own gdb binaries for your needs. I did eventually find pre-built gdb binaries for 32-bit and 64bit development at the link below:
我遇到了 Sourceforge 上官方 MinGW 发行版中提供的 gdb 问题。据我所知,gdb.exe 被配置为 mingw32,它不适用于 64 位应用程序。我也不确定你是如何从官方网站的源文件中自己构建 gdb 的。比我更有经验的人可以链接一些有关此的信息,以便您可以根据需要构建自己的 gdb 二进制文件。我最终在以下链接中找到了用于 32 位和 64 位开发的预构建 gdb 二进制文件:
回答by Frank
I ran into the same problem, and finally solved this problem by following these steps: Go to "Debug Configurations"; Choose “Environment”; Add "PATH", Value is "X:\cygwin\bin", which is the path of your cygwin folder.
我遇到了同样的问题,最后按照以下步骤解决了这个问题:转到“调试配置”;选择“环境”;添加“PATH”,值为“X:\cygwin\bin”,即你的cygwin文件夹的路径。
Then you can try to Run your code now
然后你可以尝试现在运行你的代码
回答by mark
- Upgrade to Eclipse Indigo (the latest eclipse version at the moment)
- Start Eclipse
- Go to Help|Eclipse Marketplace ...
- Switch to Yoxos Marketplace - see the orange ball near the end of the dialog
- In the Find: text box write CDT and click the Go button
- Scroll the list of found plugins until you see CDT Visual C++ Support
- Install it.
- 升级到 Eclipse Indigo(目前最新的 Eclipse 版本)
- 启动日食
- 转至帮助|Eclipse Marketplace ...
- 切换到 Yoxos 市场 - 看到对话框末尾附近的橙色球
- 在 Find: 文本框中输入 CDT 并单击 Go 按钮
- 滚动找到的插件列表,直到看到CDT Visual C++ Support
- 安装它。
Now you can compile and run, but not debug. For that you have to install the GDB debugger - I am looking into it myself right now.
现在您可以编译和运行,但不能调试。为此,您必须安装 GDB 调试器 - 我现在正在研究它。