Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeblocks doesn't stop at breakpoints

I am trying to debug C++ project in Codeblocks, but it's not stopping at breakpoints. I read the other answers and have tried the following things so far:

  1. (Build Options > Compiler Settings) Produce debugging symbols is checked, strip all symbols is unchecked.
  2. No spaces/non-ascii values in my file path.
  3. Running the debug version.
  4. Debugger in (Settings > Compiler > Toolchain Executables) set to GDB/CDB Debugger:Default
  5. Executable path in (Settings > Debugger > GDB/CDB Debugger:Default) is C:\MinGW\bin\gdb.exe.

Its still not stopping at breakpoints and the debugger log is mentioning that no debugging symbols found What am I missing here ?

like image 213
Stormbringer Avatar asked Oct 21 '14 08:10

Stormbringer


People also ask

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

How do you stop breakpoints?

To disable a single breakpoint You can disable a single breakpoint in one of the following ways: In the Query Editor window, right-click the breakpoint, and then click Disable Breakpoint.

How do I stop compiling in code blocks?

Don't close the run window!Close CB and you get a CB Pop box asking if you want to stop compiling. CB window is now greyed out and hangs. If you try to close by clicking X, it says codeblock IDE has stopped responding.


1 Answers

While trying to fix this,I came across a lot of similar questions where CodeBlocks is ignoring breakpoints during debugging, so here's the fixes I have came across so far.

1.Clean and rebuild.
2.Ensure that (Build Options > Compiler Settings) Produce debugging symbols is checked, strip all symbols is unchecked. Please ensure this is done in global settings AND project settings.This fixed it for me.
3.Check so that there are no spaces/non-ASCII values in the project file path.
4.Check if you are running the debug version, not release.The executable from Release build will be \bin\Release , and the executable from a Debug build will be in \bin\Debug .
5. Check that Debugger in (Settings > Compiler > Toolchain Executables) is set to GDB/CDB Debugger:Default.
6.Check that executable path in (Settings > Debugger > GDB/CDB Debugger:Default) is valid gdb path like (C:\MinGW\bin\gdb.exe).
7.Update Codeblocks(last resort).
Please add in comments anything else that worked for you.

like image 71
Stormbringer Avatar answered Sep 29 '22 18:09

Stormbringer