How to produce debugging symbols?

Dan Nelson dnelson at
Wed Mar 26 20:48:27 PST 2003

In the last episode (Mar 26), Martin Moeller said:
> * Dan Nelson <dnelson at> [26.03.03 21:13]: If it's your
> > program, recompile and link with the -g commandline switch added. 
> > If it's a base FreeBSD program (or port), edit the Makefile and add
> > a line reading "DEBUG_FLAGS=-g" (this will compile with -g and also
> > not strip the debugging symbols when the binary gets installed).
> Thanks for your response, Dan.
> I tried that out with gnuls package in the ports and added
> to /usr/ports/misc/gnuls/Makefile
> Without any success, though.

Ok, it looks like the ports tree doesn't fully use DEBUG_FLAGS (it does
listen to it when determining whether to strip binaries or not though). 
Try adding -g to the CFLAGS= line in /etc/make.conf .

	Dan Nelson
	dnelson at

More information about the freebsd-questions mailing list