18

I am trying to step through my program and I get the following message from Code::Blocks

Selecting target: 
Debug
ERROR: You need to specify a debugger program in the debuggers's settings.
(For MinGW compilers, it's 'gdb.exe' (without the quotes))
(For MSVC compilers, it's 'cdb.exe' (without the quotes))

Unfortunately, I cannot figure out where I would type in gdb.exe.

8 Answers 8

21
  1. Go to Settings -> Debugger -> Common -> GDB/CDB Debugger -> Default
  2. Click on executable path to find the address to gdb32.exe
  3. Locate where your codeblock is installed
  4. Follow the given path:

CodeBlock -> MinGW -> bin -> gdb32.exe (locate it and double click on it)

  1. Press OK
Sign up to request clarification or add additional context in comments.

Comments

20
  • In the Code::Blocks IDE, navigate Settings -> Debugger

  • In the tree control at the right, select Common -> GDB/CDB debugger -> Common.

  • Then in the dialog at the left you can enter Executable path and choose Debugger type = GDB or CDB, as well as configuring various other options.

1 Comment

Thanks. It seems slightly different for me. If I do Settings->Debugger I get a dialog box with Debugger settings and Common at the top. On the left is an off-shaped "tree" with Common (up) and GCB/CDB Debugger (sideways) coming out of a box and Default descending from GDB/CDB Debugger. If I click on Default (DGB/CDG Defbugger->Default) I get the parts that you mention last above (on the right).
12

For Code::Blocks 17.12.

  1. Visit http://wiki.codeblocks.org/index.php?title=MinGW_installation#TDM-GCC

  2. Follow installation's instructions.

  3. Alternatively I suggest this post.

Regards.

3 Comments

The link is dead, that's why links should not be used.
Mr. Ruli, please let me express you my glad for given me the opportunity to update my answer. In 3rd step click "this" and follow instructions. I have updated address of TDM-GCC installer. Regards.
M. Ruli, please let me tell you that link is alive. After clicking wiki.codeblocks.org/index.php?title=MinGW_installation#TDM-GCC, click the link TDM-GCC, just below paragraph header TDM-GCC. Regards.
7
  1. Click on settings in top tool bar;

  2. Click on debugger;

  3. In tree, highlight "gdb/cdb debugger" by clicking it

  4. Click "create configuration"

  5. Add "gdb.exe" (no quotes) as a configuration

  6. Delete default configuration

  7. Click on gdb.exe that you created in the tree (it should be the only one) and a dialogue will appear to the right for "executable path" with a button to the right.

  8. Click on that button and it will bring up the file that codeblocks is installed in. Just keep clicking until you create the path to the gdb.exe (it sort of finds itself).

Comments

4

Here is the tutorial to install GBD.

Usually GNU Debugger might not be in your computer, so you would install it first. The installation steps are basic "configure", "make", and "make install".

Once installed, try which gdb in terminal, to find the executable path of GDB.

Comments

1

Download codeblocks-13.12mingw-setup.exe instead of codeblocks-13.12setup.exe from the official site. Here 13.12 is the latest version so far.

Comments

1
  1. Go to Settings >> Debugger.

  2. Now as you can see in the image below. There's a tree. Common->GDB/CDB Debugger -> Default. enter image description here

  3. Click on executable path (on the right) to find the address to gdb32.exe.

  4. Click gdb32.exe >> OK.

Comments

0

Click on settings in top tool bar;

Click on debugger;

In tree, highlight "gdb/cdb debugger" by clicking it

Click "create configuration"

Click default configuration, a dialogue will appear to the right for "executable path" with a button to the right.

Click on that button and it will bring up the file that codeblocks is installed in. Just keep clicking until you create the path to the gdb.exe (it sort of finds itself).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.