From owner-freebsd-questions@FreeBSD.ORG Wed Mar 26 18:15:35 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 990CB37B404 for ; Wed, 26 Mar 2003 18:15:35 -0800 (PST) Received: from mired.org (ip68-97-54-220.ok.ok.cox.net [68.97.54.220]) by mx1.FreeBSD.org (Postfix) with SMTP id EB1E643F93 for ; Wed, 26 Mar 2003 18:15:33 -0800 (PST) (envelope-from mwm-dated-1049163332.c238ec@mired.org) Received: (qmail 61720 invoked from network); 27 Mar 2003 02:15:32 -0000 Received: from localhost.mired.org (HELO guru.mired.org) (127.0.0.1) by localhost.mired.org with SMTP; 27 Mar 2003 02:15:32 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16002.24259.753817.74124@guru.mired.org> Date: Wed, 26 Mar 2003 20:15:31 -0600 To: Dan Nelson 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> X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: Mike Meyer X-Delivery-Agent: TMDA/0.71 (Hoop, Jr.) X-Spam-Status: No, hits=-19.6 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: taxman cc: FreeBSD Questions Subject: Re: How to produce debugging symbols? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2003 02:15:38 -0000 In <20030326222553.GA38860@dan.emsphone.com>, Dan Nelson 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 . http://www.mired.org/consulting.html Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.