Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Jun 2001 09:57:10 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        "David O'Brien" <obrien@FreeBSD.org>
Cc:        Freebsd-alpha@FreeBSD.org, Andrew Gallatin <gallatin@cs.duke.edu>, Matthew Jacob <mjacob@feral.com>
Subject:   Re: -current kernel still considered dangerous
Message-ID:  <XFMail.010606095710.jhb@FreeBSD.org>
In-Reply-To: <20010606074352.B96129@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 06-Jun-01 David O'Brien wrote:
> On Wed, Jun 06, 2001 at 07:36:48AM -0700, Matthew Jacob wrote:
>> Unlike Solaris, modules are not essential to run FreeBSD. I think debugging
>> this by fixing 'debugging modules' is at best a 3rd order priority.
> 
> I thought many of the device driver folks perfer to develop via modules.
> How do they debug things?  Printf() is it?

KTR is a nice printf in disguise. :)  You can debug modules, but it isn't very
easy to do so.  Look at grog's gdb scripts in /sys/modules/vinum.
Specifically, look at .gdbinit.vinum.paths and the asf function.  It basically
walks the list of linker files looking for the first file whose name starts
with a 'v'.  Then it does an objdump on the vinum module to extract the start of
the .text section.  It uses this to create a temporary file with a
add-symbol-file command that loads the debug vinum module and adds the start
address from the linker file entry in the kernel to the .text offset to get the
final offset of the symbols.  Then it sources said file.  Fun. :-P

Basically, you use 'add-symbol-file /modules/foo.ko some_address', where
some_address = offset of .text in the module + address file is loaded at in the
kernel.

HTH.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




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