Author Topic: Code::Blocks 25.03: Debugger fails to catch breakpoints in inline/template-enhan  (Read 88 times)

Offline promotebrilliant

  • Single posting newcomer
  • *
  • Posts: 1
I'm using Code::Blocks 25.03 with GCC 12/13 and a project configured by CMake to build with multiple template/inline modules. After a successful build, when I run the debugger:
Breakpoints in inline/template functions (especially when called from template specialization) sometimes only jump once or don't catch at all, even with the debug symbol.
While breakpoints in other normal code (non-template/inline) work perfectly fine.

I've enabled -g3 and no optimization (O0), and CMake verifies that debug info is included in the binary.
Has anyone else encountered a similar problem in Code::Blocks?

Is this a bug related to how CB's GDB/Debugger handles template/inline symbols?

Are there any settings in Settings → Debugger or Project that I'm missing?

Thanks everyone!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6146
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I think your issue is not Code::Blocks related.

Because Code::Blocks just send commands by driving the gcc to compile, and drving the gdb to debug, so you can looked at the compiler plugin full log and debugger plugin full log to know all the communications.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.