From owner-freebsd-hackers Tue Mar 30 18: 6:27 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with ESMTP id 709DE1512B for ; Tue, 30 Mar 1999 18:06:19 -0800 (PST) (envelope-from peter.jeremy@auss2.alcatel.com.au) Received: by border.alcanet.com.au id <40553>; Wed, 31 Mar 1999 11:53:10 +1000 Date: Wed, 31 Mar 1999 08:07:11 +1000 From: Peter Jeremy Subject: Re: Debug kernel by default? To: hackers@FreeBSD.ORG Message-Id: <99Mar31.115310est.40553@border.alcanet.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greg Lehey wrote: >Certain people will object to any change :-) There's a valid point >that it uses more memory here, though. The VM usage by the ld step goes up substantially. For systems with small physical memory, this means lots of paging. (I have been caught a couple of times trying to re-build kernels in single user mode and the ld just hangs if I forget to manually add the swap partitions). >How about this: > > - make config assume the -g option by default. > - add a new option (-s) to config to generate stripped objects. > - add a target install.gdb to the Makefile. This target will install > the unstripped kernel for people who want to use ddb. > - modifiy the existing install target to make a stripped copy of the > kernel and to install it. Sounds good. I've already got a modified makefile, but only for aout kernels (ie 2.x and 3.0-RELEASE). I'd suggest `kernel.debug', rather than `kernel.gdb' since 1) that's what the handbook uses and 2) it avoids reference to a specific debugger. One comment on booting from unstripped kernels: Section 22.1 of the Handbook (at least in 3.1-RELEASE and up till the recent freeze in -CURRENT) states: When the kernel has been built make a copy of it, say kernel.debug, and then run strip -d on the original. Install the original as normal. You may also install the unstripped kernel, but symbol table lookup time for some programs will drastically increase, and since the whole kernel is loaded entirely at boot time and cannot be swapped out later, several megabytes of physical memory will be wasted. Is this still correct? I know that `strip -d' should be `strip -g' for ELF. Does the ELF loader still load the entire physical kernel (leaving ~6.4MB of symbol table clogging up physical memory)? I though that even the later aout kernels cleaned up the resident symbol table (though I'm not sure what they did with the freed memory). There's also a reference to using `strip -x' to just leave global symbols. Last time I tried this (probably 2.2.6), this caused some commands to fail because they were doing nlist() lookups on kernel local symbols. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message