Re: KEXT Debugging
Re: KEXT Debugging
- Subject: Re: KEXT Debugging
- From: Andrew Gallatin <email@hidden>
- Date: Mon, 6 Jan 2003 17:08:10 -0500 (EST)
Eric Long writes:
>
In debugging a network kernel extension, can I use gdb, or do I have to use
>
ddb? I'm manually loading and unloading the kext. It seems like I should
>
be able to use gdb.
You can use gdb. I think using ddb requires a kernel rebuild.
>
Is it required that I debug remotely, or can I debug on the same machine the
>
extension is running on? --Is that a dumb question? (-:
Yes, you must debug remotely. Local postmortem debugging is
impossible, since OSX doesn't use a swap partition, and doesn't have
the (highly useful) concept of crashdumps.
However, you needn't debug on another mac. You can pull the gdb
source from cvs and build a gdb which will work on another unix box.
I debug on FreeBSD. I'd be happy to share the gdb binary... I've left
it at
http://people.freebsd.org/~gallatin/macgdb.gz
Read
http://www.opensource.apple.com/projects/documentation/howto/html/kext_tutorials/hello_debugger.html
to get started debugging.
>
I haven't tried debugging in the kernel before. I found a document called
>
"KernelProgramming.pdf" that provided a lot of instructions, which I've
>
looked at, but it wasn't totally clear on these points. It only talks about
>
remote debugging, but doesn't explicitly say that local debugging is out.
>
If a breakpoint brings the whole kernel to a stop, then it makes sense that
>
debugging would have to be done remotely only.
Not entirely. If OSX had a libkvm and gdb support for it, you could
at least examine variables locally while the machine is live. This
can be very useful. As it is now, you must halt the machine and
attach a remote debugger.
Drew
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.