From owner-freebsd-questions Tue Apr 6 23:11: 0 1999 Delivered-To: freebsd-questions@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 2430615134; Tue, 6 Apr 1999 23:10:35 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id PAA12636; Wed, 7 Apr 1999 15:38:25 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id PAA13691; Wed, 7 Apr 1999 15:38:21 +0930 (CST) Message-ID: <19990407153821.L2142@lemis.com> Date: Wed, 7 Apr 1999 15:38:21 +0930 From: Greg Lehey To: Peter Wemm Cc: Archie Cobbs , Christopher Michaels , gjb@comkey.com.au, questions@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: Debug kernel by default (was: System size with -g) References: <19990407082416.H2142@lemis.com> <199904070557.NAA03953@spinner.netplex.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <199904070557.NAA03953@spinner.netplex.com.au>; from Peter Wemm on Wed, Apr 07, 1999 at 01:57:56PM +0800 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wednesday, 7 April 1999 at 13:57:56 +0800, Peter Wemm wrote: > Greg Lehey wrote: > [..] >> A number of other people have observed that the current boot loader >> doesn't load the symbols anyway, so you could install /kernel.debug >> only and still run normally. I consider this a deficiency in the boot >> loader, since it should be possible to load the symbols. Of course, >> an alternative solution would be to install /kernel.debug and leave it >> until boot time to decide whether to load the symbols. That would >> have the great advantage that you wouldn't get any mismatch between >> the two kernels. > > I'll chime in here since this was the result of something I spent a lot > of time on. > > A couple of points: > 1: The loader *does* load symbols, just not the debugging ones on elf. It > does this for runtime linking purposes. Good point. I suppose that for the benefit of others I should point out that current kernels always (should) contain some symbols (see the reference to ps(1) in another message I sent. We're talking about full ("debug") symbols here. > 2: Under ELF, the debug symbols are *seperate* to the symbol table. Aren't they under a.out as well? Otherwise strip(1) would have a lot of trouble stripping. That's probably why the bootstrap doesn't load them, too. > 3: A number of compromises had to be made to get around various > restrictions in the environment being worked in. > > At present, the only symbols that DDB *might* be able to use from the debug > symbols in the .stabs section are the line number tables to associate an > address with a line number of source. This is an awful lot of baggage to > carry for such a small gain. Yes, it would be nice to have a traceback show > line numbers in the list, but I doubt it's worth implementation cost since > the addresses can be matched in other ways. Good point. > On the whole though, I feel that the best way to deal with loading > extra debugging symbols is to do it shortly after boot. Before or after starting process 0? > And on the subject of debugging kernels getting built, I'd tend to > agree. Don't install them though, install the stripped version. I had planned to leave that to the user: 'make install' will install a stripped kernel, 'make install.debug' will install the full symbol kernel. I still think this is a reasonable compromise. > Incidently, the loader works on kernels that have been plain > stripped too, but it's restricted to global symbols only as a > result. I'm not sure I understand this. By "plain stripped" do you mean strip -g or strip -s? The way I see it, the result of 'strip -g' is identical to a kernel built without the -g option to config. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message