Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 1999 04:32:58 -0500
From:      "Christopher R. Bowman" <crb@ChrisBowman.com>
To:        Greg Lehey <grog@lemis.com>
Cc:        "Matthew D. Fuller" <fullermd@futuresouth.com>, questions@FreeBSD.ORG, FreeBSD Hackers <hackers@FreeBSD.ORG>
Subject:   Re: Debug kernel by default (was: System size with -g)
Message-ID:  <199903310948.EAA19329@quark.ChrisBowman.com>
In-Reply-To: <19990331165139.W413@lemis.com>
References:  <19990331003535.E17547@futuresouth.com> <19990331003535.E17547@futuresouth.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 04:51 PM 3/31/99 +0930, Greg Lehey wrote:
>On Wednesday, 31 March 1999 at  0:35:35 -0600, Matthew D. Fuller wrote:
>> I know this is what most people will think of as a Very Bad Idea From The
>> Get-Go, but I'm curious in any event.
>> What sort of impact on size(disk)/size(memory)/startup time/etc would
>> compiling the entire system with debugging symbols be?  (i.e., put -g in
>> CFLAGS in make.conf)  Double the size of the base system?  Quintuple?
>
>Interestingly enough, we are currently discussing this in -hackers.
>We're thinking about changing the way the kernel is built so that a
>debug kernel will be the default.
>
>To answer your question: a typical (partially) stripped kernel is
>about 1.8 MB in size.  The corresponding debug kernel is about 9 MB
>(since ELF; a.out debug kernels are about 3 MB larger).  This space is
>*in memory at all times*, so you don't normally want to load it, but
>it's good to have for dump analysis.
>
>Here are some comparative figures for building a kernel on my main
>machine (AMD K6-2/333, 160 MB memory):
>
>                 normal            debug
>Make all         4:30              5:0
>Kernel size      1.8 MB            9 MB
>Directory size   5.5 MB            24 MB
>
>The directory is so much larger because not only the kernel, but also
>all the object files contain debug symbols.  The difference in
>compilation time assumes lots of RAM; otherwise you could end up with
>a lot of paging and a corresponding increase in compilation time.
>
>The way we're talking now, it looks like we could end up with:
>
>1.  The -g option for config(8) no longer has any meaning.  With or
>    without it, you end up configuring a debug kernel.
>2.  'make install' make a copy of the kernel, called kernel.debug, and
>    strips the original kernel before installing it.
>3.  'make install.debug' would install the debug version of the
>    kernel.  This can be useful for people who use ddb or another
>    in-kernel debugger.  It's not needed for people who use a serial
>    debugger like gdb -k.
>4.  For people for whom the additional memory requirements are a
>    problem, config will have a -s (or similar) option to say 'build a
>    kernel without debugging symbols'.
>
>Any comments?  This is by no means set in stone, and we'll discuss it
>a while before we do anything.
>
>Greg

Could(are the) debugging symbols be placed in a separate ELF section and the
boot loader (or what ever it is that loads the kernel) be taught to not load
that section depending on a command line option.  Would this be at all useful? 
--------
Christopher R. Bowman
crb@ChrisBowman.com
http://www.ChrisBowman.com/


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?199903310948.EAA19329>