From owner-freebsd-questions Tue Apr 6 23: 1:28 1999 Delivered-To: freebsd-questions@freebsd.org Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (Postfix) with ESMTP id 8228214BEF; Tue, 6 Apr 1999 23:01:18 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.3/8.9.3/Netplex) with ESMTP id NAA03953; Wed, 7 Apr 1999 13:57:56 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199904070557.NAA03953@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Greg Lehey 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) In-reply-to: Your message of "Wed, 07 Apr 1999 08:24:16 +0930." <19990407082416.H2142@lemis.com> Date: Wed, 07 Apr 1999 13:57:56 +0800 From: Peter Wemm Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. 2: Under ELF, the debug symbols are *seperate* to the symbol table. 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. On the whole though, I feel that the best way to deal with loading extra debugging symbols is to do it shortly after boot. And on the subject of debugging kernels getting built, I'd tend to agree. Don't install them though, install the stripped version. Incidently, the loader works on kernels that have been plain stripped too, but it's restricted to global symbols only as a result. Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message