I posted about this in a few threads on -hackers: http://lists.freebsd.org/pipermail/freebsd-hackers/2010-November/033474.html I just thought I'd open a PR in case someone is still interested. The details are in my posts, but the basic idea behind this change is to allow users to have a 'make installworld' generate a directory (/usr/lib/debug) containing debug symbols for all of the base FreeBSD binaries. With my change, this can be done by adding an option to src.conf. At the moment, my change adds a script to src/tools/ which is the script invoked by install(1) to strip and extract the debug symbols from each binary that gets installed. I'm not sure that this is the best place for it, but it seems ok to me. Fix: I have a patch which applies against HEAD (as of a few days ago). Patch attached with submission follows:
Note, it appears an equivalent change is needed in bsd.lib.mk. It looks like the current patch will add symbols for binaries only. Work is ongoing by brooks@ to implement an install process that can produce a tar file or other output directly, which will likely be incompatible with this patch.
Now that I've had a chance to look at the patch in detail I see another issue - STRIPBIN is set to the absolute path /usr/src/tools/stripbin.sh and will not use the file in the source tree. To address this and more easily accommodate changes that brooks@ has in the pipeline we could follow the model used in kern.post.mk: explicitly invoke objcopy --only-keep-debug and --add-gnu-debuglink. It does mean we'd need to build ${PROG}.debug though, and objcopy to ${PROG} and ${PROG}.symbols in the objdir.
Changes committed in: r244224 r244236 r244408 r244915 r247054 r248753 r251512 (main part of the changes) r251513 r251601 r251685 r253580 All but r253580 (initial support for generating release sets) merged to stable/9.