int_ua
int_ua

Reputation: 1856

How to prevent QtCreator from moving breakpoints, make all lines available?

I'm trying to debug Cataclysm-DDA, a FOSS game, in QtCreator. It worked great at first, I just had to open it through the CMakeLists.txt import, set the TILES varialble to ON and select the cataclysm-tiles executable.

But when I tried to set breakpoints they sometimes move down to the point where they are useless. For example this line. I can set the breakpoint inside that function but not on that exact line, it gets moved down 5 lines where it no longer catches anything.

CMAKE_BUILD_TYPE is already set to Debug, what else can be done? I've just installed it on a relatively clean system on an old machine so everything should be default.

Upvotes: 2

Views: 634

Answers (1)

Sean Walker
Sean Walker

Reputation: 108

Moving breakpoints is usually a sign of optimization (since some lines are optimized out). Setting the build type to Debug should prevent all optimization but...

If you are using the same build directory for release and Debug (or even if not) go into the build directory and delete everything, then rerun CMake and build again. Sometimes old targets (which may have optimization) aren't automatically rebuilt.

Upvotes: 2

Related Questions