Debug buildtype broken

Andreas Pakulat apaku at gmx.de
Wed Sep 19 22:35:59 CEST 2007


On 19.09.07 22:18:12, David Faure wrote:
> On Wednesday 19 September 2007, Andreas Pakulat wrote:
> > On 19.09.07 20:15:43, Thiago Macieira wrote:
> > > Some flags suggestions:
> > > Release: -O2
> > > RelWithDebugInfo: -g -O2
> > > optimised-but-debuggable: -g -O2 -fno-inline -fno-schedule-insns -fno-reorder-blocks
> > 
> > Thats whats used for Debug right now and it doesn't work at all. I guess
> > gcc just ignores the -f's and optimizes according to -O2.
> > 
> > > Debug: -g -O0
> > > Debugfull: -g3 -O0
> > 
> > I'll change FindKDE4Internal.cmake next Monday then with the attached
> > patch. (Unless somebody has objections of course).
> 
> You're ignoring previous discussions on this...

Sorry, I didn't try to dig into the archive.

> I do agree that "-g -O2 -fno-inline -fno-schedule-insns -fno-reorder-blocks" makes
> step-by-step debugging very hard, despite what Dirk and Thiago might say.

Uhm, it makes it impossible because you can't follow the code flow. It
also makes it impossible to see certain variables. That mode is
completely useless for _anything_ besides good backtraces.

> However the point of having -O2 in the default flags is that -O2 gives better warnings
> than -O0. Without optimization, you get no warnings in many cases (e.g. unused local variable, etc.),

Strange, I build kdevplatform and kdevelop here with debugfull (-g3 -O0)
and I get tons of warnings, including unused local variables.

> and since there are more people compiling KDE than there are people doing step-by-step
> debugging, it's not completely wrong to have -O2 in the default flags...
> People who want to use gdb can use Debugfull -- just like we did in KDE3.

debugfull is not available on all platforms. Also I don't see the
problem, "first time builders" should be using Release (when KDE4 is
released) or RelWithDbgInfo (to get backtraces for initial debugging). A
"Debug" build IMHO implicates that its usable for debugging code, which
is clearly not the case for the current setup.

Andreas

-- 
Generosity and perfection are your everlasting goals.


More information about the Kde-buildsystem mailing list