Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Apr 1999 13:57:56 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Greg Lehey <grog@lemis.com>
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:  <199904070557.NAA03953@spinner.netplex.com.au>
In-Reply-To: Your message of "Wed, 07 Apr 1999 08:24:16 %2B0930." <19990407082416.H2142@lemis.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904070557.NAA03953>