|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Modular Debugger Guide Oracle Solaris 11 Express 11/10|
The Modular Debugger (MDB) is a highly extensible, general purpose debugging tool for the Oracle Solaris operating system. The Oracle Solaris Modular Debugger Guide describes how to use MDB to debug complex software systems, with a particular emphasis on the facilities available for debugging the Oracle Solaris kernel and associated device drivers and modules. This guide also includes a complete reference for and discussion of the MDB language syntax, debugger features, and MDB module programming API.
Note - This Oracle Solaris release supports systems that use the SPARC and x86 families of processor architectures. The supported systems appear in the Solaris OS: Hardware Compatibility Lists. This document cites any implementation differences between the platform types.
In this document these x86 related terms mean the following:
“x86” refers to the larger family of 64-bit and 32-bit x86 compatible products.
“x64” relates specifically to 64-bit x86 compatible CPUs.
“32-bit x86” points out specific 32-bit information about x86 based systems.
For supported systems, see the Oracle Solaris OS: Hardware Compatibility Lists.
If you were a detective and were investigating at the scene of a crime, you might interview the witnesses and ask them to describe what happened and who they saw. However, if there were no witnesses or these descriptions proved insufficient, you might consider collecting fingerprints and forensic evidence that could be examined for DNA to help solve the case. Often, software program failures divide into analogous categories: problems that can be solved with source-level debugging tools, and problems that require low-level debugging facilities, examination of core files, and knowledge of assembly language to diagnose and correct. MDB facilitates analysis of this second class of problems.
MDB is most useful when you are programming a complex low-level software system such as an operating system. The MDB debugging framework allows you to construct your own custom analysis tools to aid in the diagnosis of these low-level problems. MDB also provides a powerful set of built-in commands that enable you to analyze the state of your program at the assembly language level.
If you are not familiar with assembly language programming and debugging, Related Books and Papers provides references to materials that you might find useful.
You should disassemble various functions of interest in the programs you will be debugging in order to familiarize yourself with the relationship between your program's source code and the corresponding assembly language code. If you are planning to use MDB for debugging Oracle Solaris kernel software, read carefully Chapter 8, Kernel Debugging Modules and Chapter 9, Debugging With the Kernel Memory Allocator. These chapters provide more detailed information on the MDB commands and facilities provided for debugging the kernel software.
Chapter 1, Modular Debugger Overview provides an overview of the debugger.
Chapter 2, Debugger Concepts describes the MDB architecture and explains the terminology for the debugger concepts used throughout this book.
Chapter 3, MDB Language Syntax describes the syntax, operators and evaluation rules for the MDB language.
Chapter 4, Using MDB Commands Interactively describes the MDB interactive command-line editing facilities and output pager.
Chapter 5, Built-In Commands describes the set of built-in debugger commands that are always available.
Chapter 6, Execution Control describes the MDB facilities for controlling the execution of live running programs. This chapter is intended for application developers and device driver developers. Execution control features might also be useful for system administrators.
Chapter 7, Kernel Execution Control describes the MDB facilities for controlling the execution of the live operating system kernel that are specific to kmdb. This chapter is intended for operating system kernel developers and device driver developers.
Chapter 8, Kernel Debugging Modules describes the set of loadable debugger commands that are provided for debugging the Oracle Solaris kernel. This chapter is intended for users who intend to examine kernel crash dumps and for kernel software developers.
Chapter 9, Debugging With the Kernel Memory Allocator describes the debugging features of the Oracle Solaris kernel memory allocator and the MDB commands provided to take advantage of these features. This chapter is intended for advanced programmers and kernel software developers.
Chapter 10, Module Programming API describes the facilities for writing loadable debugger modules. This chapter is intended for advanced programmers and software developers who intend to develop custom debugging support for MDB.
Appendix A, MDB Options provides a reference for MDB command-line options.
Appendix B, Notes provides warnings and notes about using the debugger.
Appendix C, Transition From adb and kadb provides a reference for adb commands and their MDB equivalents. The adb command is implemented by mdb.
Appendix D, Transition From crash provides a reference for crash commands and their MDB equivalents. The crash command is no longer present in the Oracle Solaris OS.
The following books and papers are recommended and related to the tasks that you need to perform:
Uresh Vahalia; UNIX Internals: The New Frontiers; Prentice Hall; 2010; ISBN 978-0130210340
Richard McDougall, Jim Mauro; Solaris Internals: Solaris 10 and OpenSolaris Kernel Architecture; Prentice Hall; 2006; ISBN 978-0131482098
Richard McDougall, Jim Mauro, Brendan Gregg; Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris; Prentice Hall; 2006; ISBN 978-0131568198
David L. Weaver (editor); OpenSPARC Internals; Lulu.com; 2008; ISBN 978-0557019748
SPARC International; The SPARC Architecture Manual, Version 9; Prentice Hall; 1993; ISBN 978-0130992277
AMD64 Architecture Programmer's Manual; Advanced Micro Devices; 2006; available at http://developer.amd.com/
Intel Corporation; Pentium Pro Family Developer's Manual; McGraw-Hill Companies; 1996; ISBN 978-1555122607
Jeff Bonwick, Jonathan Adams; Magazines and Vmem: Extending the Slab Allocator to Many CPUs and Arbitrary Resourceso; Proceedings of the 2001 USENIX Annual Technical Conference; 2001; available at http://www.usenix.org/publications/library/proceedings/usenix01/full_papers/bonwick/bonwick_html/
Jeff Bonwick; The Slab Allocator: An Object-Caching Kernel Memory Allocator; Proceedings of the Summer 1994 Usenix Conference; 1994; available at http://www.usenix.org/publications/library/proceedings/bos94/bonwick.html
Third-party URLs are referenced in this document and provide additional, related information.
Note - Oracle is not responsible for the availability of third-party web sites mentioned in this document. Oracle does not endorse and is not responsible or liable for any content, advertising, products, or other materials that are available on or through such sites or resources. Oracle will not be responsible or liable for any actual or alleged damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods, or services that are available on or through such sites or resources.
See the following web sites for additional resources:
Oracle Technology Network offers a range of resources related to Oracle software:
Discuss technical problems and solutions on the Discussion Forums.
Get hands-on step-by-step tutorials with Oracle By Example.
Download Sample Code.
The following table describes the typographic conventions that are used in this book.
Table P-1 Typographic Conventions
The following table shows the default UNIX system prompt and superuser prompt for shells that are included in the Oracle Solaris OS. Note that the default system prompt that is displayed in command examples varies, depending on the Oracle Solaris release.
Table P-2 Shell Prompts