How do I use GDB in Eclipse for C/C++ Debugging?

The following instructions are for Eclipse 3.5 (Galileo). For 3.6 (Helios), they are similar except for the link in step 2.

  1. Go to Help > Install New Software.
  2. Add the CDT repository http://download.eclipse.org/tools/cdt/releases/galileo to the list of repositories.
  3. Select the CDT Repository. Now you need to install the CDT plugin along with GDB support from the list of available plugins (Select the CDT Main Features as well as CDT GNU Toolchain Debug support).

You should now be able to set breakpoints and inspect values of variables in Eclipse.

An alternative is to install DDD (an GUI frontend for GDB).

Leave a Comment