I wanna debug mac driver on a different machine, but I can't create symbol file.

my os: mavericks 10.9
xcode: 5.0.2
iokit dmg: kernel_debug_kit_10.9_13a603.dmg (from apple dev center)

1st: I use

 kextlibs -xml MyDriver.kext

it shows:

   <key>OSBundleLibraries</key>
    <dict>
        <key>com.apple.kpi.iokit</key>
        <string>13.0</string>
        <key>com.apple.kpi.libkern</key>
        <string>13.0</string>
    </dict>

2nd I use

sudo kextutil -s /tmp -n -arch x86_64 -k /Volumes/KernelDebugKit/mach_kernel -e -r /Volumes/KernelDebugKit /tmp/MyDriver.kext

it shows:

    Notice: /tmp/MyDriver.kext has debug properties set.
    /tmp/MyDriver.kext - no dependency found for com.apple.kpi.iokit.
    /tmp/MyDriver.kext - no dependency found for com.apple.kpi.libkern.
    /tmp/MyDriver.kext - no dependency found for com.apple.kpi.iokit.
    /tmp/MyDriver.kext - no dependency found for com.apple.kpi.libkern.
    Diagnostics for /tmp/MyDriver.kext:
    Dependency Resolution Failures: 
        No kexts found for these libraries: 
            com.apple.kpi.iokit
            com.apple.kpi.libkern
    Code Signing Failure: not code signed

what can I do to make it right?

1

There are 1 answers

0
pmdj On

What do you need the symbol files for? gdb/lldb when used with the debug kits for 10.7-10.9 will normally generate the offsets on the fly when you connect to the target machine and add the kext with add-kext on the debugger console. All you need is a .kext with debug info compiled directly in, or the .dSYM bundle that goes with the .kext. I'm not even sure generating symbol files like this is supported for those OSX versions.

Does your kext load on the target machine? If not, what dependencies does your kext's Info.plist declare? kextlibs only outputs the dependencies that should be in your Info.plist based on the symbols required by the binary, and assuming the current kernel version should be the earliest supported, not what is actually specified in the Info.plist.