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:
Build Options > Compiler Settings
) Produce debugging symbols
is checked, strip all symbols
is unchecked.Settings > Compiler > Toolchain Executables
) set to GDB/CDB Debugger:Default
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 ?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With