At Sun, 07 Mar 2010 01:33:43 -0500, Richard Hansen <rhansen%bbn.com@localhost>
wrote:
Subject: Confused about MKBUILD=yes
>
> While investigating a segfault in libpam on the netbsd-5 branch, I
> discovered that MKDEBUG=yes (see mk.conf(5)):
>
> * does not install debugging symbols for libraries
> * does not install any debug symbols at all (because it does not
> cause -g to be passed to gcc)
> * does not strip debug symbols from installed binaries
You need all of the following:
MKDEBUG= yes
MKDEBUGLIB= yes
DBG= -g
Actually you might want "DBG= -g -O2". I've separated debug and
optimiser option setting in my local sys.mk.
The "debug" symbols are stripped and saved to a hierarchy of files in
/usr/libdata/debug. You can load these *.debug symbol files in gdb with
the "symbol-file" command. I find that with everything static-linked I
need only load the one symbol file corresponding to the program
executable being debugged, but this might not be sufficient with
dynamic-linked programs.
I also took all the "*.debug" files out of existing distrib/sets/lists
files and moved them to new distrib/sets/lists/debug files as
appropriate so that I could avoid installing /usr/libdata/debug files on
all machines; and I tweaked the sets stuff to support MKDEBUGLIB too,
but all of this is only necessary if you want to support making
distributions for systems compiled with these options.
--
Greg A. Woods
Planix, Inc.
<woods%planix.com@localhost> +1 416 218 0099 http://www.planix.com/
Attachment:
pgpk8Qaf71dtP.pgp
Description: PGP signature