开发者

How to install GDB debugger to Eclipse CDT

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 a开发者_StackOverflows default is without GDB debugging environment, can any body give some hints on how to install gdb to Eclipse CDT?


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.

Just install into MinGW directory and set path to gdb.exe under Run->Debug Configurations->Debugger.

The latest on 05.2012 - MinGW - Minimalist GNU for Windows - gdb-7.4-2-mingw32-bin.tar.lzma


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.

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.

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).

http://www.codeproject.com/KB/tips/CPP_Dev_eclipse_CDT.aspx


Try to install Wascana that helps you installing MinGW and configure the path for you in c project if you're developing c/c++ code on Windows.


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:

http://www.equation.com/servlet/equation.cmd?fa=gdb


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.

Then you can try to Run your code now


  1. Upgrade to Eclipse Indigo (the latest eclipse version at the moment)
  2. Start Eclipse
  3. Go to Help|Eclipse Marketplace ...
  4. Switch to Yoxos Marketplace - see the orange ball near the end of the dialog
  5. In the Find: text box write CDT and click the Go button
  6. Scroll the list of found plugins until you see CDT Visual C++ Support
  7. Install it.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜