$ cd /Volumes/KernelDebugKit/
$ lldb
(lldb) target create --no-dependents --arch x86_64 mach_kernel
warning: 'mach_kernel' contains a debug script. To run this script in this debug session:
command script import "/Volumes/KernelDebugKit/mach_kernel.dSYM/Contents/Resources/Python/mach_kernel.py"
To run all discovered debug scripts in this session:
settings set target.load-script-from-symbol-file true
Current executable set to 'mach_kernel' (x86_64).
(lldb) settings set target.load-script-from-symbol-file true
Loading kernel debugging from /Volumes/KernelDebugKit/mach_kernel.dSYM/Contents/Resources/Python/mach_kernel.py
LLDB version lldb-XXX
settings set target.process.python-os-plugin-path "/Volumes/KernelDebugKit/mach_kernel.dSYM/Contents/Resources/Python/lldbmacros/core/operating_system.py"
command script import "/Volumes/KernelDebugKit/mach_kernel.dSYM/Contents/Resources/Python/lldbmacros/xnu.py"
xnu debug macros loaded successfully. Run showlldbtypesummaries to enable type summaries.
(lldb) target modules add IOAudioFamily.kext/Contents/MacOS/IOAudioFamily
(lldb) target modules add IOUSBFamily.kext/Contents/MacOS/IOUSBFamily
(lldb) image list
[ 0] 1D9369E3-D0A5-31B6-8D16-BFFBBB390393 0xffffff8000200000 /Volumes/KernelDebugKit/mach_kernel
/Volumes/KernelDebugKit/mach_kernel.dSYM/Contents/Resources/DWARF/mach_kernel
[ 1] 5077FB4F-0903-3D79-8280-5B2341E93BF3 0x0000000000000000 /Volumes/KernelDebugKit/IOAudioFamily.kext/Contents/MacOS/IOAudioFamily
/Volumes/KernelDebugKit/IOAudioFamily.kext.dSYM/Contents/Resources/DWARF/IOAudioFamily
[ 2] 972D3024-AF9C-3E09-A9EC-D9AB2A559B38 0x0000000000000000 /Volumes/KernelDebugKit/IOUSBFamily.kext/Contents/MacOS/IOUSBFamily
/Volumes/KernelDebugKit/IOUSBFamily.kext.dSYM/Contents/Resources/DWARF/IOUSBFamily
(lldb)
At this point, the images are loaded but all at their default load address. Then do
(lldb) target modules load --file mach_kernel --slide 0x000000000b600000
(lldb) target modules load --file IOAudioFamily __TEXT 0xffffff7f8c135000
section '__TEXT' loaded at 0xffffff7f8c135000
(lldb) target modules load --file IOUSBFamily __TEXT 0xffffff7f8c19a000
section '__TEXT' loaded at 0xffffff7f8c19a000
(lldb) image list
[ 0] 1D9369E3-D0A5-31B6-8D16-BFFBBB390393 0xffffff800b800000 /Volumes/KernelDebugKit/mach_kernel
/Volumes/KernelDebugKit/mach_kernel.dSYM/Contents/Resources/DWARF/mach_kernel
[ 1] 5077FB4F-0903-3D79-8280-5B2341E93BF3 0xffffff7f8c135000 /Volumes/KernelDebugKit/IOAudioFamily.kext/Contents/MacOS/IOAudioFamily
/Volumes/KernelDebugKit/IOAudioFamily.kext.dSYM/Contents/Resources/DWARF/IOAudioFamily
[ 2] 972D3024-AF9C-3E09-A9EC-D9AB2A559B38 0xffffff7f8c19a000 /Volumes/KernelDebugKit/IOUSBFamily.kext/Contents/MacOS/IOUSBFamily
/Volumes/KernelDebugKit/IOUSBFamily.kext.dSYM/Contents/Resources/DWARF/IOUSBFamily
(lldb)
We have the explicit slide for the kernel (and all segments slide together), so we can use --slide for it. Then you can use "image lookup” and “source list”, etc., to map addresses in the report to line numbers. Addresses that don’t resolve are in the 3rd party kext involved in this panic.
(lldb) image lookup -a 0xffffff800b8d6aa7
Address: mach_kernel[0xffffff80002d6aa7] (mach_kernel.__TEXT.__text + 871079)
Summary: mach_kernel`call_continuation + 23
(lldb) image lookup -a 0xffffff800b84a15a
Address: mach_kernel[0xffffff800024a15a] (mach_kernel.__TEXT.__text + 295258)
Summary: mach_kernel`thread_call_thread + 506 at thread_call.c:1218
(lldb) image lookup -a 0xffffff7f8debaa62
(lldb) image lookup -a 0xffffff800bcae4b3
Address: mach_kernel[0xffffff80006ae4b3] (mach_kernel.__TEXT.__text + 4900019)
Summary: mach_kernel`IOCommandGate::runAction(int (*)(OSObject*, void*, void*, void*, void*), void*, void*, void*, void*) + 355 at IOCommandGate.cpp:190
(lldb) image lookup -a 0xffffff7f8debbaf4
(lldb) image lookup -a 0xffffff7f8c139634
Address: IOAudioFamily[0x0000000000004634] (IOAudioFamily.__TEXT.__text + 14516)
Summary: IOAudioFamily`IOAudioDevice::activateAudioEngine(IOAudioEngine*, bool) + 94 at IOAudioDevice.cpp:903
(lldb) image lookup -a 0xffffff7f8c13aa20
Address: IOAudioFamily[0x0000000000005a20] (IOAudioFamily.__TEXT.__text + 19616)
Summary: IOAudioFamily`IOAudioEngine::start(IOService*) + 56 at IOAudioEngine.cpp:552
(lldb) image lookup -a 0xffffff7f8debe2a9
(lldb) image lookup -a 0xffffff7f8c13aadc
Address: IOAudioFamily[0x0000000000005adc] (IOAudioFamily.__TEXT.__text + 19804)
Summary: IOAudioFamily`IOAudioEngine::start(IOService*, IOAudioDevice*) + 176 at IOAudioEngine.cpp:584
(lldb) image lookup -a 0xffffff7f8debee0f
(lldb) image lookup -a 0xffffff7f8debe166
(lldb) image lookup -a 0xffffff800b8f3606
Address: mach_kernel[0xffffff80002f3606] (mach_kernel.__TEXT.__text + 988678)
Summary: mach_kernel`trap_from_kernel + 38
(lldb) image lookup -a 0xffffff800b8dc19e
Address: mach_kernel[0xffffff80002dc19e] (mach_kernel.__TEXT.__text + 893342)
Summary: mach_kernel`kernel_trap + 2046 at trap.c:790
(lldb) image lookup -a 0xffffff800b822f69
Address: mach_kernel[0xffffff8000222f69] (mach_kernel.__TEXT.__text + 135017)
Summary: mach_kernel`panic + 201 at debug.c:353
(lldb)
Shantonu
On Jan 12, 2014, at 9:08 AM, Jeff Schindler <
email@hidden> wrote: