Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 1999 08:07:11 +1000
From:      Peter Jeremy <peter.jeremy@auss2.alcatel.com.au>
To:        hackers@FreeBSD.ORG
Subject:   Re: Debug kernel by default?
Message-ID:  <99Mar31.115310est.40553@border.alcanet.com.au>

next in thread | raw e-mail | index | archive | help
Greg Lehey <grog@lemis.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Mar31.115310est.40553>