Hi,

yesterday I noticed that the Debug buildtype has the same problems as
the --enable-debug option in autohell. Its not possible to properly
debug an application that has been built with CMAKE_BUILD_TYPE=Debug.
At least not with Unix Makefile's (possibly the same applies to MinGW
Makefile's but I didn't check that). The problem is the compiler flags
that are set in this build mode:

-g -O2

this leads to gcc optimizing some parts of the code, so when stepping
through some code its not linear but you're going to jump forward and
backwards due to the optimizations. Also some local variables will be
optimized away and thus you can't inspect their value.

So the only thing for which code build with Debug buildtype is useful is
to get proper backtraces (which include function and file-information).
But that should also be possible with the RelWithDbgInfo build, or not?

The only workaround is to use debugfull, at least on *nix. On win32 if
MinGW Makefile's also include -g -O2 you're screwed because for some
reason the debugfull build type is not supported on win32.

So IMHO CMake should use -g -O0 for Debug and -g3 -O0 for debugfull
(the latter already works), now before I file a bugreport: Did I miss
anything that makes Debug not unusable (except for backtraces)?

Andreas

-- 
You have no real enemies.
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to