Eclipse – How to configure Eclipse CDT with GDB debugger

configurationeclipseeclipse-cdtgdb

I went through few queries on Eclipse CDT and GDB but I am getting more confused. I am a newbee to both GDB and eclipse.

My problem is as follows:

I have got test.exe file generated by Cygwin with a set of make files etc.
I can perform debugging using the command gdb ./Test.exe from the directory. This debugging is very sparse.

I learned that eclipse can interface with Gdb debugger and give nice GUI and debugging facility.

I will be grateful if someone can show how to load this test.exe in eclipse and run the code.

Thanks

Best Answer

Switch to c++ perspective in Eclipse.

Select Run -> Debug configurations in menu. Select C/C++ application and click on "new launch configuration" icon. Click on browse button to locate your executable, apply configuration and click the "Debug" button.

This should launch your application and locate sources, provided you compiled with -g3 (or similar). Make sure you also used -O0. (BTW: I tried this with mingw, not cygwin).

You could import Makefile project into Eclipse/CDT and use Eclipse for development.