trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: November 2011

Re: [trinity-devel] Cmake build with debug support

From: Darrell Anderson <humanreadable@...>
Date: Sun, 27 Nov 2011 10:17:04 -0800 (PST)
> > > > With autotools I use --enable-debug=full.
> > > >
> > > > How is this done with cmake ?
> > > >
> > > > I built with -DCMAKE_BUILD_TYPE=Debug but
> there is no
> > >
> > > difference in the
> > >
> > > > final package sizes.
> > > >
> > > > Is there anything in the build log that lets
> me know
> > >
> > > how I built a package?
> > >
> > > Try -DCMAKE_CXX_FLAGS="-g"
> >
> > I added that flag. Yet the package sizes are the
> same.
> >
> > 1. How do I know whether or not a package is built
> with debug support?
> 
> Run make VERBOSE=1 and check if -g parameter is passed to
> compiler.
> 
> > 2. Does the build log provide a clue?
> 
> See previous answer.
> 
> > 3. Should the package size be larger?
> 
> Yes, much larger. But ensure that binaries are not stripped
> at install stage 
> (you should not see "-s" parameter passed to linker). Use
> "file" to check if 
> the binary is stripped or no.
> 
> > 4. Is there a simple test after installing the package
> to test for
> > debugging support?
> 
> Dunno.

In all of my build scripts is this:

make VERBOSE=1

I rebuilt kdelibs using this:

-DCMAKE_CXX_FLAGS:STRING="$CPUOPT $DEBUG_CMAKE"

where $DEBUG_CMAKE = -g

When I check the build log I see this many times:

/usr/bin/c++  -fPIC -O2 -march=i486 -mtune=i686 -g

When I run 'gdb attach [PID]' I see many "(no debugging symbols found)" messages. For example:

Reading symbols from /opt/trinity/lib/libkparts.so.2...(no debugging symbols found)...done.
Loaded symbols for /opt/trinity/lib/libkparts.so.2
Reading symbols from /opt/trinity/lib/libkio.so.4...(no debugging symbols found)...done.
Loaded symbols for /opt/trinity/lib/libkio.so.4
Reading symbols from /opt/trinity/lib/libkdeui.so.4...(no debugging symbols found)...done.
Loaded symbols for /opt/trinity/lib/libkdeui.so.4

As I mentioned the package sizes are the same and built times are basically the same. Everything indicates I am not building with debug support.

What else do I need to do?

Darrell