Re: kext debugging
Re: kext debugging
- Subject: Re: kext debugging
- From: Michael Crawford <email@hidden>
- Date: Sun, 12 Dec 2010 10:54:23 -0800
This doesn't answer the question you asked, but will save you a lot of
time and trouble once you *are* able to get GDB to debug your kext.
Setting up a kext for debugging according to Apple's instructions is
quite tedious, labor-intensive and error prone. It takes a long time
for each round of compile, test and debug. You'll go out of your tree
in short order if you keep typing all those commands by hand.
Once you are quite certain you know how to set up a kext for
debugging, write a BASH shell script that does all that for you
instead. I did, and it changed my life in an incredibly positive way.
I'm sorry, but I had to reformat my drive quite unexpectedly a while
back so I don't have my script anymore, but it's not hard to write.
If you don't know how to write shell scripts, just google for:
unix shell tutorial
... and you'll be scripting in no time.
It's really best to use two Macs for kext debugging, so if you panic
your kernel on the test machine, your development machine is not
affected. When testing buggy kexts, there is always the possibility
that a crash can cause filesystem corruption, despite the journaled
HFS+ filesystem.
I do realize that you might only own one Mac, but if you ARE using
two, have that shell script scp your kext from your dev machine to
your test machine. See "man scp" in the Terminal.
You can give ssh on your test machine a short script that it will
execute on your dev machine. Have that script tar or zip your kext,
transfer the compressed archive to your test machine, put that archive
in the test machine's /tmp directory, unpack the archive so it's a
kext bundle again, then use "sudo cp -R" to copy it to the
/System/Library/Extensions folder. Then have your script get GDB and
the addresses and stuff set up.
You'll be glad you did. ;-)
Mike
--
Michael David Crawford
mdcrawford at gmail dot com
Custom Software Development for the iPhone and Mac OS X
http://www.dulcineatech.com/custom-software-development/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden