Our lovely gdb has been declared dead with Xcode 5 release. The new king in town is lldb, and that also applies to kernel debugging. Change is good, even if we Humans don’t like it, but… there’s still no gdbinit for lldb and I just love it. Even more important (for kernel debugging), lldb still has no support (afaik) for VMware gdb stub. This means it’s not possible to do kernel debugging in Mavericks VMs other than KDP. I like the gdb stub a lot; ctrl+c and bang we got kernel control.
I needed to do some research with Mavericks so I decided to port the kgmacros script to Mavericks. It was easier than I expected, just some fixes to structures that changed. Most functions are working ok, and there are a few private helper commands I added last yet while I doing some research. Mostly improvements related to physical memory functions. The most important commands, at least for me, are fully working.
The script is available at Github repo. The kgmacros file is for Mountain Lion, and kgmacros_mavericks for Mavericks.
One small tip if you are doing two real machines debugging with lldb and thunderbolt. You will need to set the boot args parameter “kdp_match_name=en4” if you are using a thunderbolt to ethernet adapter in the target machine. KDP expects by default the network interface in en0 and the thunderbolt adapter is set as en4. Other than that everything works. It just needs the gdbinit like output and commands. Deroko started a version here. Go help him, I don’t want to learn Python (again) ;-).