I'm developing a KEXT on mac using Xcode, After every compile I'm changing permissions through terminal and load the KEXT, then reading results from console app. Some of the mistakes in development giving system a kernel panic and I have to restart my mac, this is so annoying. I was wondering if there is a better way to develop and debug a KEXT?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This is too big a topic for an answer, but it is at least well documented, look at these documents from Apple:
- When Things Go Wrong: Debugging the Kernel
- Debugging a Kernel Extension with GDB
- Technical Note TN2063: Understanding and Debugging Kernel Panics
Also note that you can get the output from kprintf()
logging calls via Firewire (using the fwkpfv
command-line utility on the other Mac) or Serial Port (mainly useful for testing in VMs, as modern Macs don't have serial ports). kprintf
is synchronous, so unlike the kernel.log you will see the debug output even if it occurs immediately before a crash.