Skip to main content

Posts

Showing posts with the label debug

Setting up a Windows VM for Kernel Debugging

If you search the web using the title of this post, you'll get many links to articles most of which explain how to set this up using a virtual COM port on the VM. Coming from driver background that goes back over 20 years, at first this seemed quite natural. But then I remembered that using WinDBG over COM port to be painfully slow. And recent adventures in OSX land using LLDB led me to wonder if WinDBG over network would to be possible? Well it turns out that WinDBG over Ethernet is indeed possible and is documented by Microsoft here . However, they miss out on certain key steps, which won't be obvious for the casual reader unless one reads the entire driver debugging documentation from the beginning. This post captures all the requisite steps as a quick reference guide. I used one of the freely available MSEdge on Windows 10 VM for   VirtualBox . It's only valid for 90 days, but 90 days was more than enough for my little excursion into the driver land. If you want a...

Setting up OS X for kernel debugging

Here are the steps to prepare an OS X system for debugging kernel modules such as drivers. The instructions are deliberately brief to save the reader from tons of text. If you search the web, you will come across may resources that point to using GDB to debug the kernel. These resources were written in the early days of OS X when versions 10.4 or 10.5 were prevalent. Since around v10.9 (or thereabouts), Mac moved to lldb as their debugger of choice and have continually improved it to enable easier setup & more efficient workflow. This short post has the instructions to setting up lldb for debugging OS X kernel versions 10.11 and above. My setup is using a Parallels VM as the target on the development system. But it should work on a separate hardware that is connected via network to the host. Debuggee is the target system where drivers are deployed and tested. This also referred to as the target system. Debugger is the host system, typically running your development tools wi...