[Index]


Table of Contents


Title and Copyright Pages

About This Manual
Audience
New and Changed Features
Organization
Related Documents
Reader's Comments
Conventions

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    Kernel Debugging Flag
2.1.2    Debugging Stripped Images
2.1.3    Examining Memory Contents
2.1.4    Printing the Values of Variables and Data Structures
2.1.5    Displaying a Data Structure Format
2.1.6    Debugging Multiple Threads
2.1.7    Examining the Exception Frame
2.1.8    Extracting the Preserved Message Buffer
2.1.9    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
2.2.3.1    Displaying the Address Resolution Protocol Table
2.2.3.2    Performing Commands on Array Elements
2.2.3.3    Displaying the Buffer Table
2.2.3.4    Displaying the Callout Table and Absolute Callout Table
2.2.3.5    Casting Information Stored in a Specific Address
2.2.3.6    Displaying Machine Configuration
2.2.3.7    Converting the Base of Numbers
2.2.3.8    Displaying CPU Use Statistics
2.2.3.9    Disassembling Instructions
2.2.3.10    Displaying Remote Exported Entries
2.2.3.11    Displaying the File Table
2.2.3.12    Displaying the udb and tcb Tables
2.2.3.13    Performing Commands on Lists
2.2.3.14    Displaying the lockstats Structures
2.2.3.15    Displaying lockinfo Structures
2.2.3.16    Displaying the Mount Table
2.2.3.17    Displaying the Namecache Structures
2.2.3.18    Displaying Processes' Open Files
2.2.3.19    Converting the Contents of Memory to Symbols
2.2.3.20    Displaying the Process Control Block for a Thread
2.2.3.21    Formatting Command Arguments
2.2.3.22    Displaying the Process Table
2.2.3.23    Converting an Address to a Procedure name
2.2.3.24    Displaying Sockets from the File Table
2.2.3.25    Displaying a Summary of the System Information
2.2.3.26    Displaying a Summary of Swap Space
2.2.3.27    Displaying the Task Table
2.2.3.28    Displaying Information About Threads
2.2.3.29    Displaying a Stack Trace of Threads
2.2.3.30    Displaying a u Structure
2.2.3.31    Displaying References to the ucred Structure
2.2.3.32    Removing Aliases
2.2.3.33    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    Managing Crash Dumps
4.1    Crash Dump Creation
4.2    Choosing the Contents of Crash Dumps
4.2.1    Including User Page Tables in Partial Crash Dumps
4.2.2    Selecting Partial or Full Crash Dumps
4.3    Planning Crash Dump Space
4.3.1    Estimating the Size of Partial Crash Dumps
4.3.2    Estimating the Size of Full Crash Dumps
4.3.3    Adjusting the Primary Swap Partition's Crash Dump Threshold
4.4    Crash Dump File Creation and Crash Dump Logging
4.4.1    Crash Dump File Creation
4.4.2    Crash Dump Logging
4.5    Planning and Allocating File System Space for Crash Dump Files
4.6    Compressing and Uncompressing Crash Dump Files
4.7    Creating Dumps of a Hung System

5    Crash Analysis Examples
5.1    Guidelines for Examining Crash Dump Files
5.2    Identifying a Crash Caused by a Software Problem
5.2.1    Using dbx to Determine the Cause of a Software Panic
5.2.2    Using kdbx to Determine the Cause of a Software Panic
5.3    Identifying a Hardware Exception
5.3.1    Using dbx to Determine the Cause of a Hardware Error
5.3.2    Using kdbx to Determine the Cause of a Hardware Error
5.4    Finding a Panic String in a Thread Other Than the Current Thread
5.5    Identifying the Cause of a Crash on an SMP System

A    Output from the crashdc Command

Index