JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Modular Debugger Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Modular Debugger Overview

2.  Debugger Concepts

3.  MDB Language Syntax

4.  Using MDB Commands Interactively

5.  Built-In Commands

6.  Execution Control

7.  Kernel Execution Control

Booting, Loading, and Unloading

Terminal Handling

Debugger Entry

Processor-Specific Features

8.  Kernel Debugging Modules

9.  Debugging With the Kernel Memory Allocator

10.  Module Programming API

A.  MDB Options

B.  Notes

C.  Transition From adb and kadb

D.  Transition From crash

Index

Booting, Loading, and Unloading

To facilitate the debugging of kernel startup, kmdb can be loaded during the earliest stages of the boot process, before control has passed from the kernel runtime linker (krtld) to the kernel.

On an Oracle Solaris 11 x86 system, grub is loaded first , and you can boot kmdb by adding the -kor -kd options to the grub kernel line.

On an Oracle Solaris 11.1 x86 system, grub is loaded first, and you can change the boot options to load kmdb in one of the following ways:

If kmdb is loaded at boot, the debugger cannot be unloaded until the system subsequently reboots. Some functionality will not be immediately available during the earliest stages of boot. In particular, debugging modules will not be loaded until the kernel module subsystem has initialized. Processor-specific functionality will not be enabled until the kernel has completed the processor identification process.

If you boot your system using the -k option, kmdb will automatically load during the boot process. You can use the -d boot option to request a debugger breakpoint prior to starting the kernel. This feature works with the default kernel as well as alternate kernels. For example, to boot a SPARC system with kmdb and request immediate entry to the debugger, type any of the following commands:

ok boot -kd
ok boot kmdb -d
ok boot kadb -d

To boot an x86 system in the same manner, type any of the following commands:

Select (b)oot or (i)nterpreter: b -kd
Select (b)oot or (i)nterpreter: b kmdb -d
Select (b)oot or (i)nterpreter: b kadb -d    

To boot a SPARC system with kmdb and load an alternate 64–bit kernel, type the following command:

ok boot kernel.test/sparcv9/unix -k

To boot an x86 system with  kmdb and load an alternate 64–bit kernel, type the following command:

Select (b)oot or (i)nterpreter: b kernel.test/amd64/unix -k

If the boot file is set to the string kmdb or kadb and you want to boot an alternate kernel, use the -D option to specify the name of the kernel to boot. To boot a SPARC system in this manner, type the following command:

ok boot kmdb -D kernel.test/sparcv9/unix

To boot a 64–bit x86 system in this manner, type the following command:

Select (b) or (i)nterpreter: b kmdb -D kernel.test/amd64/unix

To debug a system that has already booted, use the mdb -K option to load kmdb and stop kernel execution. When the debugger is loaded using this method, it can be subsequently unloaded. You can unload kmdb when you are done debugging by specifying the -u option to the ::quit dcmd. Alternatively, you can resume execution of the operating system using the command mdb -U.