Building OpenSlide with debug symbols

Benjamin Gilbert bgilbert at cs.cmu.edu
Wed Nov 14 17:50:30 EST 2012


On 11/14/2012 11:52 AM, Agelos Pappas wrote:
> how can we build OpenSlide with debug symbols?

The default CFLAGS are "-O2 -g", so you should get them by default.  On 
Linux, binaries are typically built *with* symbols and debug 
information, which are then removed if desired (with the "strip" 
command, or "make install-strip" in an Autotools package).

> ./build.sh bdistLDFLAGS="-g" CFLAGS="-g"

build.sh doesn't allow command-line overrides of CFLAGS; you'd have to 
modify the script for that.

> In both cases, where do the debug symbol files go? Where can we find them?

Debug symbols are embedded in the executable, in special ELF or PE sections.

> Does Valgrind use them automagically if they exist?

It should.

Note that the binaries shipped by Linux distributions typically do not 
include debug information.  So, for example, a stack trace through 
libjpeg-turbo won't be very helpful.  On Debian/Ubuntu/Fedora/RHEL, the 
debug symbols are separately packaged: on Fedora/RHEL you can get them 
with the debuginfo-install command, and on Debian/Ubuntu you can 
"apt-get install <package>-dbg".

--Benjamin Gilbert


More information about the openslide-users mailing list