Debug buildtype broken

Dirk Mueller mueller at kde.org
Sat Sep 22 00:33:25 CEST 2007


On Wednesday, 19. September 2007, David Faure wrote:

> -fno-reorder-blocks" makes step-by-step debugging very hard, despite what
> Dirk and Thiago might say.

it depends on your gcc version of course. there are still many outstanding 
issues, but it is a longer term goal to make this work. 

I however would not like to see an option for "-g3" - we're not using that 
much macros to justify the tremendous overhead. 

> However the point of having -O2 in the default flags is that -O2 gives
> better warnings than -O0.

Yes, this is the main point. It also gives you a variable and code layout that 
is similar to the release builds that are part of a distribution. I can't 
stress this point enough because I'm often debugging issues that "go away 
with -O0" and are therefore claimed to be compiler bugs, even though the bug 
is in the actual source, just that optimisation uncovered it. 

It is not an often done debugging job to debug a heavily eventbased 
interactive application (like KDE applications generally are) in a debugger 
and stepping through it line by line. it is just too complex, especially if 
you have to step through hundreds of inline expansions of trivial accessors 
to get somewhere. 

therefore, the default debug build should be a reasonable optimized build with 
good backtraces. 


Greetings,
Dirk


More information about the Kde-buildsystem mailing list