Date: Wed, 26 Mar 2003 20:15:31 -0600 From: Mike Meyer <mwm-dated-1049163332.c238ec@mired.org> To: Dan Nelson <dnelson@allantgroup.com> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: How to produce debugging symbols? Message-ID: <16002.24259.753817.74124@guru.mired.org> In-Reply-To: <20030326222553.GA38860@dan.emsphone.com> References: <20030326200449.GB967@bsdsi.homeunix.com> <20030326201149.GE31787@dan.emsphone.com> <200303261710.11281.taxman@acd.net> <20030326222553.GA38860@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In <20030326222553.GA38860@dan.emsphone.com>, Dan Nelson <dnelson@allantgroup.com> typed: > In the last episode (Mar 26), taxman said: > > On Wednesday 26 March 2003 03:11 pm, Dan Nelson wrote: > > > 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 no strip the debugging symbols when the binary > > > gets installed). > > Does this work for the kernel? I'd read that the kernel strips > > symbols anyway. If i put makeoptions DEBUG=-g in my kernel config > > (as shown in LINT) will I still get the symbols? Thats for 4.x, what > > about 5.0 is that different? > It still works in 5.0. What ends up happenning is a debugging kernel > gets built as kernel.debug, but the stripped version is still installed > into /boot/kernel/ (most likely to conserve space on /). When you > panic and coredump, copy kernel.debug out of the source tree into > /var/crash and use that to debug. That's the difficult way to do this. You can debug the core and kernel dumps in /sys/crash, and use the gdb symbol-file command to load the symbols from kernel.debug. This is all documented in the kernel debugging section of the developer's handbook link at <URL: http://www.freebsd.org/docs.html >. <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/consulting.html Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16002.24259.753817.74124>