Saltycrane logo

SaltyCrane Blog

Notes on Python, Django, and web development on Ubuntu Linux

    

How to use the mingw gdb debugger with Eclipse 3.2 / CDT 3.1

How to use the mingw gdb debugger with Eclipse 3.2 / CDT 3.1
  1. Go to http://sourceforge.net/project/showfiles.php?group_id=2435&package;_id=20507, download gdb-5.2.1-1.exe, and run it to install.
  2. Create a C Project and build it.
  3. From the "Run" menu, select "Debug..."
  4. Click on "C/C++ Local Application", then click the 'New' button (it is a button with a plus sign in the top left corner).
  5. Click the "Search Project..." button and select your executable.
  6. Click on the "Environment" tab, and click "New..."
  7. In the "Name:" field, enter "Path". In the "Value:" field, enter "c:\mingw\bin". Click "OK".
  8. Click the "Debugger" tab. From the "Debugger:" dropdown box, select "gdb Debugger".
  9. Click "Debug". Your gdb debugger session should now begin.
  10. If you get a "Confirm Perspective Switch" dialog, click on "Yes" to switch to the Debug perspective.
  11. You can now use the buttons in your "Debug" window to step through your code.
See also my post, How to setup the MinGW gcc tools for your Managed Make C Project in CDT 3.1 and Eclipse 3.2

Technorati tags:

8 Comments — feed icon Comments feed for this post


#1 Keith commented on 2008-02-25:

Hi there; appreciate that you put this on your blog. By any chance, however, does this same configuration work with Eclipse 3.3 and CDT 4.0.1? I'm getting all kinds of errors.


#2 sofeng commented on 2008-03-26:

Keith,
sorry, i haven't tried this with Eclipse 3.3 / CDT 4.0. i've been using Emacs, so i haven't done too much with Eclipse recently


#3 Anonymous commented on 2008-07-10:

the link to the gdb debugger does not work.


#4 sofeng commented on 2008-07-10:

Anonymous,
Thanks, I fixed the link.


#5 DannyStaple commented on 2010-03-18:

Also worth noting is that you will need to download the MingW expat dll too for GDB to run.


#6 kj commented on 2010-08-13:

Hi, your link to the GDB doesn't work today and the MinGW installer still doesn't contain it.

But I found Wascana for Eclipse

http://code.google.com/a/eclipselabs.org/p/wascana/

It provides MinGW along with the debugger. You can update your eclipse via the repository or download an entire updated eclipse. That's how I got the working c++-Debugger in Eclipse.

HTH, kev


#7 QW commented on 2010-11-18:

I copied the link http://svn.codespot.com/a/eclipselabs.org/wascana/repo and install new software in Eclipse. However, I don't see any difference after installation.


#8 Russell Potter commented on 2011-11-04:

I followed the ptofrdure given om your article (except that my Eclipse had a "Run Configurations" item directly in the "Run" menu - although that differ- ence dis probably because I;m I'm using EClipse Indigo), but when press on the "Debug" button, I get the error message: "Error in final launch sequence Failed to execute MI command: -exec-run rror message from debugger back end: Error creating process, (error 740).". what causes this error snd how do I get around it?

Post a comment

Required
Required, but not displayed
Optional

Format using Markdown. (No HTML.)
  • Code blocks: prefix each line by at least 4 spaces or 1 tab (and a blank line before and after)
  • Code span: surround with backticks
  • Blockquotes: prefix lines to be quoted with >
  • Links: <URL>
  • Links w/ description: [description](URL)
Created with Django | Hosted by Slicehost