Section 13.1. Invoking MDB


13.1. Invoking MDB

MDB is available on Solaris systems as two commands that share common features:mdb and kmdb. You can use the mdb command interactively or in scripts to debug live user processes, user process core files, kernel crash dumps, the live operating system, object files, and other files. You can use the kmdb command to debug the live operating system kernel and device drivers when you also need to control and halt the execution of the kernel. To start mdb, execute the mdb(1) command.

The following example shows how mdb can be started to examine a live kernel.

sol8# mdb -k Loading modules: [ unix krtld genunix specfs dtrace ufs ip sctp usba uhci s1394 fcp fctl emlxs nca lofs zfs random nfs audiosup sppp crypto md fcip logindmux ptm ipc ] > 


To start mdb with a kernel crash image, specify the namelist and core image names on the command line.

sol8# cd /var/crash/myserver sol8# ls /var/crash/* bounds    unix.1    unix.3    unix.5    unix.7    vmcore.1  vmcore.3  vmcore.5  vmcore.7 unix.0    unix.2    unix.4    unix.6    vmcore.0  vmcore.2  vmcore.4  vmcore.6 sol8# mdb -k unix.1 vmcore.1 Loading modules: [ unix krtld genunix specfs dtrace ufs ip sctp usba uhci s1394 fcp fctl emlxs nca lofs zfs random nfs audiosup sppp crypto md fcip logindmux ptm ipc ] > 


To start mdb with a process target, enter either a command to execute or a process ID with the -p option.

# mdb /usr/bin/ls > # mdb -p 121 Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libuutil.so.1 ] 


To start kmdb, boot the system or execute the mdb command with the -K option as described in Chapter 14.

13.1.1. Logging Output to a File

It's often useful to log output to a file, so arrange for that early on by using the ::log dcmd.

> ::log mymdb.out mdb: logging to "mymdb.out" 





Solaris Performance and Tools(c) Dtrace and Mdb Techniques for Solaris 10 and Opensolaris
Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris
ISBN: 0131568191
EAN: 2147483647
Year: 2007
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net