Title and Copyright Information
About This Manual
Related Documents
Reader's Comments
1    Introduction to Kernel Debugging
1.1    Linking a Kernel Image for Debugging
1.2    Debugging Kernel Programs
1.3    Debugging the Running Kernel
1.4    Analyzing a Crash Dump File
2    Kernel Debugging Utilities
2.1    The dbx Debugger
2.1.1    Invoking the dbx Debugger for Kernel Debugging
2.1.2    Debugging Stripped Images
2.1.3    Specifying the Location of Loadable Modules for Crash Dumps
2.1.4    Examining Memory Contents
2.1.5    Printing the Values of Variables and Data Structures
2.1.6    Displaying a Data Structure Format
2.1.7    Debugging Multiple Threads
2.1.8    Examining the Exception Frame
2.1.9    Examining the User Program Stack
2.1.10    Extracting the Preserved Message Buffer
2.1.11    Debugging on SMP Systems
2.2    The kdbx Debugger
2.2.1    Beginning a kdbx Session
2.2.2    The kdbx Debugger Commands
2.2.3    Using kdbx Debugger Extensions    Displaying the Address Resolution Protocol Table    Performing Commands on Array Elements    Displaying the Buffer Table    Displaying the Callout Table and Absolute Callout Table    Casting Information Stored in a Specific Address    Displaying Machine Configuration    Converting the Base of Numbers    Displaying CPU Use Statistics    Disassembling Instructions    Displaying Remote Exported Entries    Displaying the File Table    Displaying the udb and tcb Tables    Performing Commands on Lists    Displaying the lockstats Structures    Displaying lockinfo Structures    Displaying the Mount Table    Displaying the Namecache Structures    Displaying Processes' Open Files    Converting the Contents of Memory to Symbols    Displaying the Process Control Block for a Thread    Formatting Command Arguments    Displaying the Process Table    Converting an Address to a Procedure name    Displaying Sockets from the File Table    Displaying a Summary of the System Information    Displaying a Summary of Swap Space    Displaying the Task Table    Displaying Information About Threads    Displaying a Stack Trace of Threads    Displaying a u Structure    Displaying References to the ucred Structure    Removing Aliases    Displaying the vnode Table
2.3    The kdebug Debugger
2.3.1    Getting Ready to Use the kdebug Debugger
2.3.2    Invoking the kdebug Debugger
2.3.3    Diagnosing kdebug Setup Problems
2.3.4    Notes on Using the kdebug Debugger
2.4    The crashdc Utility
3    Writing Extensions to the kdbx Debugger
3.1    Basic Considerations for Writing Extensions
3.2    Standard kdbx Library Functions
3.2.1    Special kdbx Extension Data Types
3.2.2    Converting an Address to a Procedure Name
3.2.3    Getting a Representation of an Array Element
3.2.4    Retrieving an Array Element Value
3.2.5    Returning the Size of an Array
3.2.6    Casting a Pointer to a Data Structure
3.2.7    Checking Arguments Passed to an Extension
3.2.8    Checking the Fields in a Structure
3.2.9    Setting the kdbx Context
3.2.10    Passing Commands to the dbx Debugger
3.2.11    Dereferencing a Pointer
3.2.12    Displaying the Error Messages Stored in Fields
3.2.13    Converting a Long Address to a String Address
3.2.14    Freeing Memory
3.2.15    Passing Commands to the kdbx Debugger
3.2.16    Getting the Address of an Item in a Linked List
3.2.17    Passing an Extension to kdbx
3.2.18    Getting the Next Token as an Integer
3.2.19    Getting the Next Token as a String
3.2.20    Displaying a Message
3.2.21    Displaying Status Messages
3.2.22    Exiting from an Extension
3.2.23    Reading the Values in Structure Fields
3.2.24    Returning a Line of kdbx Output
3.2.25    Reading an Area of Memory
3.2.26    Reading the Response to a kdbx Command
3.2.27    Reading Symbol Representations
3.2.28    Reading a Symbol's Address
3.2.29    Reading the Value of a Symbol
3.2.30    Getting the Address of a Data Representation
3.2.31    Converting a String to a Number
3.3    Examples of kdbx Extensions
3.4    Compiling Custom Extensions
3.5    Debugging Custom Extensions
4    Crash Analysis Examples
4.1    Guidelines for Examining Crash Dump Files
4.2    Identifying a Crash Caused by a Software Problem
4.2.1    Using dbx to Determine the Cause of a Software Panic
4.2.2    Using kdbx to Determine the Cause of a Software Panic
4.3    Identifying a Hardware Exception
4.3.1    Using dbx to Determine the Cause of a Hardware Error
4.3.2    Using kdbx to Determine the Cause of a Hardware Error
4.4    Finding a Panic String in a Thread Other Than the Current Thread
4.5    Identifying the Cause of a Crash on an SMP System
A    Output from the crashdc Command
3-1    Template Extension Using Lists
3-2    Extension That Uses Linked Lists: callout.c
3-3    Template Extensions Using Arrays
3-4    Extension That Uses Arrays: file.c
3-5    Extension That Uses Global Symbols: sum.c
2-1    Using a Gateway System During Remote Debugging
2-1    The dbx Address Modes
2-2    The dbx Address Modes