Date: Wed, 7 Apr 1999 15:38:21 +0930 From: Greg Lehey <grog@lemis.com> To: Peter Wemm <peter@netplex.com.au> Cc: Archie Cobbs <archie@whistle.com>, Christopher Michaels <ChrisMic@clientlogic.com>, gjb@comkey.com.au, questions@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: Debug kernel by default (was: System size with -g) Message-ID: <19990407153821.L2142@lemis.com> In-Reply-To: <199904070557.NAA03953@spinner.netplex.com.au>; from Peter Wemm on Wed, Apr 07, 1999 at 01:57:56PM %2B0800 References: <19990407082416.H2142@lemis.com> <199904070557.NAA03953@spinner.netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990407153821.L2142>