Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm a Visual Studio user and am used to breakpoints for debugging. I'm now working in a linux environment and am using Eclipse as an IDE. I'm a newbie in linux and eclipse. I don't have any idea how to use gdb in eclipse. I tried using gdb in command line, but is not as easy as having a UI.

How do I use gdb in eclipse?

like image 324
Owen Avatar asked Sep 21 '10 09:09

Owen


1 Answers

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

like image 108
Omair Avatar answered Nov 01 '22 08:11

Omair