Subject: Re: Debugging Kernel changes.
To: Joshua Dinerstein <forge@netbsd.warped.com>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: tech-kern
Date: 06/24/1997 12:58:47
> 
> 	Hi Peoples,
> 
> 	I need a little more help with some BSD kernel development. I am 
> trying to make some changes to the NFS part of the kernel.
> 
> 	For some reason my code changes are making the kernel crash. 
> Strange I know :), but it does seem to be happening.
> 
> 	So what I am wondering is this. Is there anyway to run the kernel 
> in a debug mode or with a debugger? Something where I could get a better 
> idea of what is really going wrong and why it is causing these crashes?
> 
> 	If anyone has any suggestions, information, or pointers to 
> documents that would discuss this I would really appriciate it. As I have 
> gone as far as I can with that I have/know now.

As I understand it, there are basically four ways of doing this:

1) liberal use of printf's (my favorite)

2) core dump groveling (I think you just need a kernel image with
symbols still in it for this one, and the stock gdb)

3) the in-kernel debugger, which you can invoke by Debugger()

4) kdb, the kernel debugger. For this one, you use a serial port
(or some other port) to talk to another computer running the kdb
program. This method sounds WAY cool, but I'm not familiar with
how to do it.

I'm sure other folks will fill in all the details I've left out
(which is what I hope, so I'll learn these details :-)

Take care,

Bill