Debugging Kernel Extensions
New Kext Commands: kextfind, kextlibs
New Application: SleepX
Updated Application: IORegistryExplorer
See the GDB Release Notes for information on how to debug kernel extensions with DWARF. Note that you must generate debug symbols on the same architecture as the machine you are debugging.
Leopard adds two new commands dealing with kernel extensions. kextfind(8)
helps you find kernel extensions based on a wide array of query parameters, as well as generate reports listing details of found kexts. kextlibs(8)
, run on a built kernel extension, determines the library kexts needed for loading; you can take the output of this command and add it directly to your kernel extension’s OSBundleLibraries property in Xcode. See the man pages for more information.
The SleepX application, located at /Developer/Applications/Utilities/SleepX.app
, automates sleep/wake testing, so that you can stress-test your driver’s power-management functionality. To start a sleep test, open SleepX, enter how long you want the machine to remain awake and asleep, followed by the number of sleep cycles to run for, and click the Start button.
The IORegistryExplorer application, located at /Developer/Applications/Utilities/IORegistryExplorer.app
, has been completely redesigned and rewritten for Leopard. Among the many changes and new features are:
An outline view shows you the relationships between registry entries in a more practical form. Several menu commands, with key equivalents, provide convenient navigation of the registry; see the View and Go menus for these commands. Browser view is still available.
Multiple explorer windows, which can be based on independent snapshots of the kernel registry state (using the New Explorer command), or can share them for synchronized viewing of different places within the registry (the New Viewer Window command).
Ability to save and open registry documents. You can save a registry snapshot and send it in a bug report. IORegistryExplorer documents preserve more information than ioreg(8)
dumps and may prove more useful for certain problems.
A pop-up list of the registry paths that lead to the same kernel object, across all planes. Use this to confirm attachment points and debug registry traversal or lookup problems.
Automatic and timed update functionality, to keep your registry explorer windows up to date as objects come and go. Automatic updates capture any objects being added to or removed from the registry; timed updates capture all other changes.
Preservation of terminated registry objects in the explorer, so that you can inspect their state, as last recorded, at the time they were discovered to have been terminated. Terminated objects are shown in red, strikethrough text. See the Registry and View menus for commands to manipulate terminated objects.
Highlight of newly-created registry objects, as of the last update. New objects are shown in green, underlined text. Note that since this status is cleared on an update, you may want to turn off automatic and timed updates when looking for new objects.
Number/data formatting options are applied per-property (and per-class if you so choose), and saved to user defaults. See the View/Show Property Options command.
Dynamic Find, with a variety of options available via the Go/Show Find Options command. You can search on object name, class, inheritance, bundle ID, property key or value (string only), and state. State searches use special keywords for registered, matched, active, busy, new, and terminated (dead) objects. You can add “not” or “!” at the beginning to negate the sought value.
A property preview table, on the Find Options pane. You can enter a name in the “Show Property” field, and values for that property in all matching objects are displayed in the table.
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)
|