<?Pub UDT _bookmark _target?><?Pub EntList amp nbsp gt lt ndash hyphen?><?Pub CX solbook(book(title()bookinfo()chapter(4)?><chapter id="commands-1"><title>Built-In Commands</title><highlights><para>MDB provides a set of built-in dcmds that are always defined. Some of
these dcmds are applicable only to certain targets: if a dcmd is not applicable
to the current target, it fails and prints a message indicating &ldquo;command
is not supported by current target&rdquo;. </para><para>In many cases, MDB provides a mnemonic equivalent (<command>::identifier</command>)
for the legacy <olink targetdoc="refman1" targetptr="adb-1" remap="external"><citerefentry><refentrytitle>adb</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> dcmd
names. For example, <command>::quit</command> is provided as the equivalent
of <literal>$q</literal>. Programmers who are experienced with <olink targetdoc="refman1" targetptr="adb-1" remap="external"><citerefentry><refentrytitle>adb</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> or who appreciate brevity
or arcana might prefer the <literal>$</literal> or <literal>:</literal> forms
of the built-ins. Programmers who are new to MDB might prefer the more verbose <literal>::</literal> form. The built-ins are shown in alphabetical order. If a <literal>$</literal> or <literal>:</literal> form has a <command>::identifier</command> equivalent,
it is shown under the <command>::identifier</command> form.</para>
</highlights><sect1 id="commands-2"><title>Built-In dcmds</title><variablelist termlength="wholeline"><varlistentry><term>&gt; <replaceable>variable-name</replaceable></term><term>&gt;
/<replaceable>modifier</replaceable>/ <replaceable>variable-name</replaceable></term><listitem><para>Assign the value of dot to the specified named variable. Some
variables are read-only and cannot be modified. If the <literal>&gt;</literal> is
followed by a modifier character surrounded by <?Pub _nolinebreak?><literal>//</literal><?Pub
/_nolinebreak?>, then the value is modified as part of the assignment. The
modifier characters are:</para><variablelist><varlistentry><term><literal>c</literal></term><listitem><para>Unsigned char quantity (1-byte)</para>
</listitem>
</varlistentry><varlistentry><term><literal>s</literal></term><listitem><para>Unsigned short quantity (2-byte)</para>
</listitem>
</varlistentry><varlistentry><term><literal>i</literal></term><listitem><para>Unsigned int quantity (4-byte)</para>
</listitem>
</varlistentry><varlistentry><term><literal>l</literal></term><listitem><para>Unsigned long quantity (4-byte in 32-bit, 8-byte in 64-bit)</para>
</listitem>
</varlistentry>
</variablelist><para>Notice that these operators do not perform a cast; they instead fetch
the specified number of low-order bytes (on little-endian architectures) or
high-order bytes (big-endian architectures). These modifiers are provided
for backward compatibility; the MDB */<replaceable>modifier</replaceable>/
and %/<replaceable>modifier</replaceable>/ syntax should be used instead.</para>
</listitem>
</varlistentry><varlistentry><term><literal>$&lt;</literal> <replaceable>macro-name</replaceable></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$&lt;</literal></secondary></indexterm>Read and execute commands from the specified macro file. The file
name can be given as an absolute or relative path. If the file name is a simple
name (that is, if it does not contain a '<literal>/</literal>'), MDB searches
for it in the macro file include path. If another macro file is currently
being processed, this file is closed and replaced with the new file.</para>
</listitem>
</varlistentry><varlistentry><term><literal>$&lt;&lt;</literal> <replaceable>macro-name</replaceable></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$&lt;&lt;</literal></secondary></indexterm>Read and execute commands from the specified macro file (as with <literal>$&lt;</literal>), but do not close the current open macro file.</para>
</listitem>
</varlistentry><varlistentry><term><literal>$?</literal></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$?</literal></secondary></indexterm>Print the process-<acronym>ID</acronym> and current signal of
the target if it is a user process or core file, and then print the general
register set of the representative thread.</para>
</listitem>
</varlistentry><varlistentry><term>[ <replaceable>address</replaceable> ] <literal>$C</literal> [ <replaceable>count</replaceable> ]</term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$C</literal></secondary></indexterm>Print a C stack backtrace, including stack frame pointer information.
If the dcmd is preceded by an explicit <replaceable>address</replaceable>,
a backtrace beginning at this virtual memory address is displayed. Otherwise,
the stack of the representative thread is displayed. If an optional count
value is given as an argument, no more than <replaceable>count</replaceable> arguments
are displayed for each stack frame in the output.</para><note arch="sparc" wordsize="bits64"><para>The biased frame pointer value
(that is, the virtual address minus <literal>0x7ff</literal>) should be used
as the address when requesting a stack trace.</para>
</note>
</listitem>
</varlistentry><varlistentry><term>[ <replaceable>base</replaceable> ] <literal>$d</literal></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$d</literal></secondary></indexterm>Get or set the default output radix. If the dcmd is preceded by
an explicit expression, the default output radix is set to the given <replaceable>base</replaceable>; otherwise, the current radix is printed in base 10 (decimal).
The default radix is base 16 (hexadecimal).</para>
</listitem>
</varlistentry><varlistentry><term><literal>$e</literal></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$e</literal></secondary></indexterm>Print a list of all known external (global) symbols of type object
or function, the value of the symbol, and the first 4 (32-bit <command>mdb</command>)
or 8 (64-bit <command>mdb</command>) bytes stored at this location in the
target's virtual address space. The <command>::nm</command> dcmd provides
more flexible options for displaying symbol tables.</para>
</listitem>
</varlistentry><varlistentry><term><literal>$P</literal> <replaceable>prompt-string</replaceable></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$P</literal></secondary></indexterm>Set the prompt to the specified <replaceable>prompt-string</replaceable>.
The default prompt is ' <literal>&gt;</literal> '. The prompt can also be set
using <command>::set</command> <option>P</option> or the <option>P</option> command-line
option.</para>
</listitem>
</varlistentry><varlistentry><term><literal>$M</literal></term><listitem><para>In <command>kmdb</command> only, list the macro files that
are cached by <command>kmdb</command> for use with the <literal>$&lt;</literal> dcmd.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>distance</replaceable> <literal>$s</literal></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$s</literal></secondary></indexterm>Get or set the symbol matching <replaceable>distance</replaceable> for
address-to-symbol-name conversions. The symbol matching distance modes are
discussed along with the <option>s</option> command-line option in <olink targetptr="options-1" remap="internal">Appendix&nbsp;A, Options</olink>. The symbol matching
distance can also be modified using the <command>::set</command> <option>s</option> option.
If no distance is specified, the current setting is displayed.</para>
</listitem>
</varlistentry><varlistentry><term><literal>$v</literal></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$v</literal></secondary></indexterm>Print a list of the named variables that have non-zero values.
The <command>::vars</command> dcmd provides other options for listing variables.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>width</replaceable> <literal>$w</literal></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$w</literal></secondary></indexterm>Set the output page <replaceable>width</replaceable> to the specified
value. Typically, this command is not necessary, as MDB queries the terminal
for its width and handles resize events.</para>
</listitem>
</varlistentry><varlistentry><term><literal>$W</literal></term><listitem><para><indexterm><primary>dcmds</primary><secondary><literal>$W</literal></secondary></indexterm>Reopen the target for writing, as if MDB had been executed with
the <option>w</option> option on the command line. Write mode can also be
enabled with the <command>::set</command> <option>w</option> option.</para>
</listitem>
</varlistentry><varlistentry><term><command>::array</command> <replaceable>type</replaceable> <replaceable>count</replaceable></term><listitem><para>Print the address of each element of an array. The type of
the array elements should be specified as the first argument, <replaceable>type</replaceable>,
and the number of elements to be computed should be specified as the second
argument, <replaceable>count</replaceable>. The output of <command>::array</command> can
be pipelined to the <command>::print</command> dcmd to print the elements
of an array data structure.</para><note><para>This dcmd may only be used with objects that contain compressed
symbolic debugging information designed for use with <literal>mdb</literal>.
This information is currently only available for certain Solaris kernel modules.
The SUNWzlib decompression software must be installed in order to process
the symbolic debugging information. </para>
</note>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="attach"><command>::attach</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary sortas="A"><command>:A</command></secondary>
</indexterm><term>[ <replaceable>pid</replaceable> ] <command>::attach</command> [ <replaceable>core</replaceable> | <replaceable>pid</replaceable> ]</term><term>[ <replaceable>pid</replaceable> ] <command>:A</command> [ <replaceable>core</replaceable> | <replaceable>pid</replaceable> ]</term><listitem><para>If the user process target is active, attach to and debug
the specified process-<acronym>ID</acronym> or <replaceable>core</replaceable> file.
The core file path name should be specified as a string argument. The process-<acronym>ID</acronym> can be specified as the string argument, or as the value of the
expression preceding the dcmd. Recall that the default base is hexadecimal,
so decimal <acronym>PID</acronym>s obtained using <olink targetdoc="refman1" targetptr="pgrep-1" remap="external"><citerefentry><refentrytitle>pgrep</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> or <olink targetdoc="refman1" targetptr="ps-1" remap="external"><citerefentry><refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> should be preceded with &ldquo;<literal>0t</literal>&rdquo;
when specified as expressions.</para>
</listitem>
</varlistentry><varlistentry><term><command>::branches</command> [ <option>v</option> ]</term><listitem><para>Display the most recent branches taken by the current CPU.
This dcmd is currently only available when using <command>kmdb</command> on
x86 systems where the appropriate processor-specific feature is enabled. The
number and type of branches that can be displayed is determined by the processor
architecture. If the <option>v</option> option is present, the instructions
prior to each branch are displayed.</para>
</listitem>
</varlistentry><varlistentry><term><command>::cat</command> <replaceable>filename</replaceable> ...</term><listitem><para><indexterm><primary>dcmds</primary><secondary sortas="cat"><command>::cat</command></secondary></indexterm>Concatenate and display files. Each
file name can be specified as a relative or absolute path name. The file contents
will print to standard output, but will not pass through the output pager.
This dcmd is intended to be used with the <literal>|</literal> operator; the
programmer can initiate a pipeline using a list of addresses stored in an
external file.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="context"><command>::context</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$p</literal></secondary>
</indexterm><term><replaceable>address</replaceable> <command>::context</command></term><term><replaceable>address</replaceable> <literal>$p</literal></term><listitem><para>Context switch to the specified process. A context switch
operation is valid only when using the kernel target. The process context
is specified using the <replaceable>address</replaceable> of its <literal>proc</literal> structure
in the kernel's virtual address space. The special context address <literal>0</literal> is
used to denote the context of the kernel itself. MDB can only perform a context
switch when examining a crash dump if the dump contains the physical memory
pages of the specified user process (as opposed to just kernel pages). The
kernel crash dump facility can be configured to dump all pages or the pages
of the current user process using <olink targetdoc="refman1m" targetptr="dumpadm-1m" remap="external"><citerefentry><refentrytitle>dumpadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>. The <command>::status</command> dcmd
can be used to display the contents of the current crash dump.</para><para>When the user requests a context switch from the kernel target, MDB
constructs a new target representing the specified user process. After the
switch occurs, the new target interposes its dcmds at the global level: thus
the <literal>/</literal> dcmd can now format and display data from the virtual
address space of the user process, the <command>::mappings</command> dcmd
can display the mappings in the address space of the user process, and so
on. The kernel target can be restored by executing <command>0::context</command>.</para>
</listitem>
</varlistentry><varlistentry><term><command>::cpuregs</command> [ <option>c</option> <replaceable>cpuid</replaceable> ]</term><listitem><para>Display the current general-purpose register set for the current
CPU or the specified <replaceable>cpuid</replaceable>. This command is only
available when using <command>kmdb</command>.</para>
</listitem>
</varlistentry><varlistentry><term><command>::cpustack</command> [ <option>c</option> <replaceable>cpuid</replaceable> ]</term><listitem><para>Display a C stack backtrace for the thread executing on the
current CPU or the specified <replaceable>cpuid</replaceable>. This command
is only available when using <command>kmdb</command>.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="dcmds"><command>::dcmds</command></secondary>
</indexterm><term><command>::dcmds</command></term><listitem><para>List the available dcmds and print a brief description for
each one.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="dis"><command>::dis</command></secondary>
</indexterm><term>[ <replaceable>address</replaceable> ] <command>::dis</command> [ <option>abfw</option> ] [ <option>n</option> <replaceable>count</replaceable> ] [ <replaceable>address</replaceable> ]</term><listitem><para>Disassemble starting at or around the <replaceable>address</replaceable> specified
by the final argument, or the current value of dot. If the address matches
the start of a known function, the entire function is disassembled. Otherwise,
a &ldquo;window&rdquo; of instructions before and after the specified address
is printed in order to provide context. By default, instructions are read
from the target's virtual address space; if the <option>f</option> option
is present, instructions are read from the target's object file instead. The <option>f</option> option is enabled by default if the debugger is not currently attached
to a live process, core file, or crash dump. The <option>w</option> option
can be used to force window-mode, even if the address is the start of a known
function. The size of the window defaults to ten instructions. The number
of instructions can be specified explicitly using the <option>n</option> option.
If the <option>a</option> option is present, addresses are printed as numeric
values rather than symbolically. The <option>b</option> option displays both
address and symbol names of the disassembled code. (The <option>b</option> option
is available starting with SXCE build 88.)</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="disasms"><command>::disasms</command></secondary>
</indexterm><term><command>::disasms</command></term><listitem><para>List the available disassembler modes. When a target is initialized,
MDB attempts to select the appropriate disassembler mode. The user can change
the mode to any of the modes listed using the <command>::dismode</command> dcmd.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="dismode"><command>::dismode</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$V</literal></secondary>
</indexterm><term><command>::dismode</command> [ <replaceable>mode</replaceable> ]</term><term><literal>$V</literal> [ <replaceable>mode</replaceable> ]</term><listitem><para>Get or set the disassembler mode. If no argument is specified,
print the current disassembler mode. If a <replaceable>mode</replaceable> argument
is specified, switch the disassembler to the specified mode. The list of available
disassemblers can be displayed using the <command>::disasms</command> dcmd.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="dmods"><command>::dmods</command></secondary>
</indexterm><term><command>::dmods</command> [ <option>l</option> ] [ <replaceable>module-name</replaceable> ]</term><listitem><para>List the loaded debugger modules.  If the <option>l</option> option
is specified, the list of the dcmds and walkers associated with each dmod
is printed below its name. The output can be restricted to a particular dmod
by specifying its name as an additional argument.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="dump"><command>::dump</command></secondary>
</indexterm><term><command>[<replaceable>address</replaceable>]
::dump [<option>eqrstu</option>] [<option>f</option>|<option>p</option>] [<option>g</option> <replaceable>bytes</replaceable>] [<option>w</option> <replaceable>paragraphs</replaceable>]</command></term><listitem><para>Print a hexadecimal and <acronym>ASCII</acronym> memory dump
of the 16-byte aligned region of virtual memory containing the address specified
by dot. If a repeat count is specified for <command>::dump</command>, this
is interpreted as a number of bytes to dump rather than a number of iterations.
The <command>::dump</command> dcmd also recognizes the following options:</para><variablelist><varlistentry><term><option>e</option></term><listitem><para>Adjust for endianness. The <option>e</option> option assumes
4-byte words; the <option>g</option> option can be used to change the default
word size.</para>
</listitem>
</varlistentry><varlistentry><term><option>f</option></term><listitem><para>Read data from the object file location corresponding to the
given virtual address instead of from the target's virtual address space.
The <option>f</option> option is enabled by default if the debugger is not
currently attached to a live process, core file, or crash dump.</para>
</listitem>
</varlistentry><varlistentry><term><option>g</option> <replaceable>group</replaceable></term><listitem><para>Display bytes in groups of bytes.  The default <replaceable>group</replaceable> size is 4 bytes. The <replaceable>group</replaceable> size
must be a power of two that divides the line width</para>
</listitem>
</varlistentry><varlistentry><term><option>p</option></term><listitem><para>Interpret <replaceable>address</replaceable> as a physical
address location in the target's address space instead of a virtual address.</para>
</listitem>
</varlistentry><varlistentry><term><option>q</option></term><listitem><para>Do not print an ASCII decoding of the data.</para>
</listitem>
</varlistentry><varlistentry><term><option>r</option></term><listitem><para>Number lines relative to the start address instead of with
the explicit address of each line. This option implies the <option>u</option> option.</para>
</listitem>
</varlistentry><varlistentry><term><option>s</option></term><listitem><para>Elide repeated lines.</para>
</listitem>
</varlistentry><varlistentry><term><option>t</option></term><listitem><para>Only read from and display the contents of the specified addresses,
instead of reading and printing entire lines.</para>
</listitem>
</varlistentry><varlistentry><term><option>u</option></term><listitem><para>Unalign output instead of aligning the output at a paragraph
boundary. </para>
</listitem>
</varlistentry><varlistentry><term><option>w</option> <replaceable>paragraphs</replaceable></term><listitem><para>Display paragraphs 16-byte paragraphs per line.  The default
number of paragraphs is one.  The maximum value accepted for <option>w</option> is
16.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="echo"><command>::echo</command></secondary>
</indexterm><term><command>::echo</command> [ <replaceable>string</replaceable> | <replaceable>value</replaceable> ... ]</term><listitem><para>Print the arguments separated by blanks and terminated by
a <symbol>NEWLINE</symbol> to standard output. Expressions enclosed in <literal>$[
]</literal> will be evaluated to a value and printed in the default base.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="eval"><command>::eval</command></secondary>
</indexterm><term><command>::eval</command> <replaceable>command</replaceable></term><listitem><para>Evaluate and execute the specified string as a command. If
the command contains metacharacters or white space, it should be enclosed
in double or single quotes.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="files"><command>::files</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$f</literal></secondary>
</indexterm><term><command>::files</command> [<replaceable>object</replaceable>]<?Pub _newline?><literal>$f</literal></term><listitem><para>Print a list of the known source files (symbols of type <symbol>STT_FILE</symbol> present in the various target symbol tables). If an <replaceable>object</replaceable> name is specified, the output is restricted to file symbols
present in the corresponding object file.</para>
</listitem>
</varlistentry><varlistentry><term><command>[<replaceable>address</replaceable>] ::findsym
[<option>g</option>] [ <replaceable>address</replaceable> | <replaceable>symbol</replaceable> ...]</command></term><listitem><para>Search instruction text for instructions that refer to the
specified symbols or addresses. The search list should consist of one or more
addresses or symbol names specified as an address preceding the dcmd or one
or more symbol names or expressions following the dcmd. If the <option>g</option> option
is specified, the search is restricted to instruction text that is part of
a globally visible function in the target's symbol table.</para><note><para><emphasis>SPARC only</emphasis>. The <command>::findsym</command> dcmd
is only available when debugging a target that uses the SPARC instruction
set architecture.</para>
</note>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="formats"><command>::formats</command></secondary>
</indexterm><term><command>::formats</command></term><listitem><para>List the available output format characters for use with the <literal>/</literal>, <literal>\</literal>, <literal>?</literal>, and <literal>=</literal> formatting
dcmds. The formats and their use is described in <olink targetptr="syntax-15" remap="internal">Formatting
Dcmds</olink>.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="fpregs"><command>::fpregs</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$x</literal></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$X</literal></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$y</literal></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$Y</literal></secondary>
</indexterm><term><command>[ thread ] ::fpregs [<option>dqs</option>]</command></term><term><command>[ thread ] $x, $X, $y, $Y</command></term><listitem><para>Print the floating-point register set of the representative
thread. If a thread is specified, the floating point registers of that thread
are displayed.  The thread expression should be one of the thread identifiers
described under <olink targetptr="exec-ctrl-11" remap="internal">Thread Support</olink>.</para><note><para>SPARC only.  The <option>d</option>, <option>q</option>, and <option>s</option> options can be used to display the floating point registers as
a collection of double-precision (<option>d</option>), quad-precision (<option>q</option>),
or single-precision (<option>s</option>) floating point values.</para>
</note>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="grep"><command>::grep</command></secondary>
</indexterm><term><command>::grep</command> <replaceable>command</replaceable></term><listitem><para>Evaluate the specified command string, then print the old
value of dot if the new value of dot is non-zero. If the <replaceable>command</replaceable> contains
white space or metacharacters, it must be quoted. The <command>::grep</command> dcmd
can be used in pipelines to filter a list of addresses.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="help"><command>::help</command></secondary>
</indexterm><term><command>::help</command> [ <replaceable>dcmd-name</replaceable> ]</term><listitem><para>With no arguments, the <command>::help</command> dcmd prints
a brief overview of the help facilities available in MDB. If a <replaceable>dcmd-name</replaceable> is specified, MDB prints a usage summary for that dcmd.</para>
</listitem>
</varlistentry><varlistentry><term>[ <replaceable>address</replaceable> [ , <replaceable>len</replaceable> ]] <command>::in</command> [ <option>L</option> <replaceable>len</replaceable> ]</term><listitem><para>Read and display <replaceable>len</replaceable> bytes from
the I/O port specified by <replaceable>address</replaceable>. The value of
the <option>L</option> option, if present, takes precedence over the repeat
count specified on the left-hand side. The <replaceable>len</replaceable> must
be 1, 2, or 4 bytes and the port address must be aligned according to the
length. This command is only available when using <command>kmdb</command> on
x86 systems.</para>
</listitem>
</varlistentry><varlistentry><term>[ <replaceable>address</replaceable> ] <command>::list</command> <replaceable>type member</replaceable> [ <replaceable>variable-name</replaceable> ]</term><listitem><para>Walk through the elements of a linked list data structure
and print the address of each element in the list. The address of the first
element in the list can be specified using an optional <replaceable>address</replaceable>;
otherwise the list is assumed to start at the current value of dot. The <replaceable>type</replaceable> parameter must name a C struct or union type and is used
to describe the type of the list elements so that MDB can read in objects
of the appropriate size. The <replaceable>member</replaceable> parameter is
used to name the member of <replaceable>type</replaceable> that contains a
pointer to the next list element. The <command>::list</command> dcmd will
continue iterating until a NULL pointer is encountered, the first element
is reached again (a circular list), or an error occurs while reading an element.
If the optional <replaceable>variable-name</replaceable> is specified, the
specified variable will be assigned the value returned at each step of the
walk when MDB invokes the next stage of a pipeline.</para><note><para>This dcmd may only be used with objects that contain compressed
symbolic debugging information designed for use with <literal>mdb</literal>.
This information is currently only available for certain Solaris kernel modules.
The SUNWzlib decompression software must be installed in order to process
the symbolic debugging information. </para>
</note>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="load"><command>::load</command></secondary>
</indexterm><term><command>::load</command> [ <option>s</option>] <replaceable>module-name</replaceable></term><listitem><para>Load the specified dmod. The module name can be given as an
absolute or relative path. If <replaceable>module-name</replaceable> is a
simple name (that is, does not contain a '<literal>/</literal>'), MDB searches
for it in the module library path. Modules with conflicting names cannot be
loaded; the existing module must be unloaded first. If the <literal>-s</literal> option
is present, MDB will remain silent and not issue any error messages if the
module is not found or could not be loaded.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="log"><command>::log</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$&gt;</literal></secondary>
</indexterm><term><command>::log</command> [ <option>d</option> | [ <option>e</option> ] <replaceable>filename</replaceable> ]</term><term><literal>$&gt;</literal> [ <replaceable>filename</replaceable> ]</term><listitem><para>Enable or disable the output log. MDB provides an interactive
logging facility where both the input commands and standard output can be
logged to a file while still interacting with the user. The <option>e</option> option
enables logging to the specified file, or re-enables logging to the previous
log file if no file name is given. The <option>d</option> option disables
logging. If the <literal>$&gt;</literal> dcmd is used, logging is enabled if
a file name argument is specified; otherwise, logging is disabled. If the
specified log file already exists, MDB appends any new log output to the file.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="map"><command>::map</command></secondary>
</indexterm><term><command>::map</command> <replaceable>command</replaceable></term><listitem><para>Map the value of dot to a corresponding value using the <replaceable>command</replaceable> specified as a string argument, then print the new value
of dot. If the command contains white space or metacharacters, it must be
quoted. The <command>::map</command> dcmd can be used in pipelines to transform
the list of addresses into a new list of addresses.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="mappings"><command>::mappings</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$m</literal></secondary>
</indexterm><term>[ <replaceable>address</replaceable> ] <command>::mappings</command> [ <replaceable>name</replaceable> ]</term><term>[ <replaceable>address</replaceable> ] <literal>$m</literal> [ <replaceable>name</replaceable> ]</term><listitem><para>Print a list of each mapping in the target's virtual address
space, including the address, size, and description of each mapping. If the
dcmd is preceded by an <replaceable>address</replaceable>, MDB shows only
the mapping that contains the given address. If a string <replaceable>name</replaceable> argument
is given, MDB shows only the mapping that matched the description.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="nm"><command>::nm</command></secondary>
</indexterm><term><command>[<replaceable>address</replaceable>]
::nm</command> [ <option>DPdghnopuvx</option> ] [ <option>t</option> <replaceable>types</replaceable> ] [ <option>f</option> <replaceable>format</replaceable> ]
[ <replaceable>object</replaceable>]</term><listitem><para>Print the symbol tables associated with the current target.
If an optional <replaceable>address</replaceable> preceding the dcmd is specified,
only the symbol table entry for the symbol corresponding to address is displayed.
If an <replaceable>object</replaceable> name is specified, only the symbol
table for this load object is displayed. The <command>::nm</command> dcmd
also recognizes the following options:</para><variablelist><varlistentry><term><option>D</option></term><listitem><para>Prints <literal>.dynsym</literal> (dynamic symbol table) instead
of <literal>.symtab</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><option>P</option></term><listitem><para>Prints the private symbol table instead of <literal>.symtab</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><option>d</option></term><listitem><para>Prints value and size fields in decimal.</para>
</listitem>
</varlistentry><varlistentry><term><option>f</option> format [,format...]</term><listitem><para>Print only the specified symbol information.  The valid format
argument strings are:</para><variablelist><varlistentry><term>ndx</term><listitem><para>symbol table index</para>
</listitem>
</varlistentry><varlistentry><term>val</term><listitem><para>symbol table</para>
</listitem>
</varlistentry><varlistentry><term>size</term><listitem><para>size in bytes</para>
</listitem>
</varlistentry><varlistentry><term>type</term><listitem><para>symbol type</para>
</listitem>
</varlistentry><varlistentry><term>bind</term><listitem><para>binding</para>
</listitem>
</varlistentry><varlistentry><term>oth</term><listitem><para>other</para>
</listitem>
</varlistentry><varlistentry><term>shndx</term><listitem><para>section index</para>
</listitem>
</varlistentry><varlistentry><term>name</term><listitem><para>symbol name</para>
</listitem>
</varlistentry><varlistentry><term>ctype</term><listitem><para>C type for symbol (if known)</para>
</listitem>
</varlistentry><varlistentry><term>obj</term><listitem><para>object which defines symbol</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry><varlistentry><term><option>g</option></term><listitem><para>Prints only global symbols.</para>
</listitem>
</varlistentry><varlistentry><term><option>h</option></term><listitem><para>Suppresses the header line.</para>
</listitem>
</varlistentry><varlistentry><term><option>n</option></term><listitem><para>Sorts symbols by name.</para>
</listitem>
</varlistentry><varlistentry><term><option>o</option></term><listitem><para>Prints value and size fields in octal.</para>
</listitem>
</varlistentry><varlistentry><term><option>p</option></term><listitem><para>Prints symbols as a series of <command>::nmadd</command> commands.
This option can be used with <option>P</option> to produce a macro file that
can be subsequently read into the debugger with <literal>$&lt;</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><option>t</option> type [,type...]</term><listitem><para>Prints only symbols of the specified types. The valid type
argument strings are:</para><variablelist><varlistentry><term>noty</term><listitem><para>STT_NOTYPE</para>
</listitem>
</varlistentry><varlistentry><term>objt</term><listitem><para>STT_OBJECT</para>
</listitem>
</varlistentry><varlistentry><term>func</term><listitem><para>STT_FUNC</para>
</listitem>
</varlistentry><varlistentry><term>sect</term><listitem><para>STT_SECTION</para>
</listitem>
</varlistentry><varlistentry><term>file</term><listitem><para>STT_FILE</para>
</listitem>
</varlistentry><varlistentry><term>comm</term><listitem><para>STT_COMMON</para>
</listitem>
</varlistentry><varlistentry><term>tls</term><listitem><para>STT_TLS</para>
</listitem>
</varlistentry><varlistentry><term>regi</term><listitem><para>STT_SPARC_REGISTER</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry><varlistentry><term><option>u</option></term><listitem><para>Prints only undefined symbols.</para>
</listitem>
</varlistentry><varlistentry><term><option>v</option></term><listitem><para>Sorts symbols by value.</para>
</listitem>
</varlistentry><varlistentry><term><option>x</option></term><listitem><para>Prints value and size fields in hexadecimal.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="nmadd"><command>::nmadd</command></secondary>
</indexterm><term><replaceable>value</replaceable> <command>::nmadd</command> [ <option>fo</option> ] [ <option>e</option> <replaceable>end</replaceable> ]
[ <option>s</option> <replaceable>size</replaceable> ] <replaceable>name</replaceable></term><listitem><para>Add the specified symbol <replaceable>name</replaceable> to
the private symbol table. MDB provides a private, configurable symbol table
that can be used to interpose on the target's symbol table, as described in <olink targetptr="syntax-16" remap="internal">Symbol Name Resolution</olink>. The <command>::nmadd</command> dcmd
also recognizes the following options:</para><variablelist><varlistentry><term><option>e</option></term><listitem><para>Set the size of the symbol to <replaceable>end</replaceable> - <replaceable>value</replaceable>.</para>
</listitem>
</varlistentry><varlistentry><term><option>f</option></term><listitem><para>Set the type of the symbol to <literal>STT_FUNC</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><option>o</option></term><listitem><para>Set the type of the symbol to <literal>STT_OBJECT</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><option>s</option></term><listitem><para>Set the size of the symbol to <replaceable>size</replaceable>.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="nmdel"><command>::nmdel</command></secondary>
</indexterm><term><command>::nmdel</command> <replaceable>name</replaceable></term><listitem><para>Delete the specified symbol <replaceable>name</replaceable> from
the private symbol table.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="objects"><command>::objects</command></secondary>
</indexterm><term><command>::objects</command> [ <option>v</option> ]</term><listitem><para>Print a map of the target's virtual address space, showing
only those mappings that correspond to the primary mapping (usually the text
section) of each of the known load objects. If the <option>v</option> option
is present, the command displays the version of each object if version information
is know. If no version information is known, a version of <literal>Unknown</literal> will
be displayed in the output.</para>
</listitem>
</varlistentry><varlistentry><term><command>::offsetof</command> <replaceable>type member</replaceable></term><listitem><para>Print the offset of the specified member of the specified
type. The type should be the name of a C structure. The offset is printed
in bytes, unless the member is a bit-field in which case the offset may be
printed in bits. The output is always suffixed with the appropriate units
for clarity. The type name may use the backquote (<literal>`</literal>) scoping
operator described in <olink targetptr="syntax-16" remap="internal">Symbol Name Resolution</olink>.</para><note><para>This dcmd may only be used with objects that contain compressed
symbolic debugging information designed for use with <literal>mdb</literal>.
This information is currently only available for certain Solaris kernel modules.
The SUNWzlib decompression software must be installed in order to process
the symbolic debugging information. </para>
</note>
</listitem>
</varlistentry><varlistentry><term>[ <replaceable>address</replaceable> [ , <replaceable>len</replaceable> ]] <command>::out</command> [ <option>L</option> <replaceable>len</replaceable> ]</term><listitem><para>Write the specified <replaceable>value</replaceable> to the
I/O port specified by <replaceable>address</replaceable>. The value of the <option>L</option> option, if present, takes precedence over the repeat count specified
on the left-hand side. The <replaceable>len</replaceable> must be 1, 2, or
4 bytes and the port address must be aligned according to the length. This
command is only available when using <command>kmdb</command> on x86 systems.</para>
</listitem>
</varlistentry><varlistentry><term><command>[<replaceable>address</replaceable>] ::print
[<option>aCdiLptx</option>] [<option>c</option> <replaceable>lim</replaceable>]
[<option>l</option> <replaceable>lim</replaceable>] [<replaceable>type</replaceable> [<replaceable>member</replaceable>|<replaceable>offset</replaceable> ... ]]</command></term><listitem><para>Print the data structure at the specified virtual <replaceable>address</replaceable> using the given <replaceable>type</replaceable> information.
The <replaceable>type</replaceable> parameter may name a C struct, union,
enum, fundamental integer type, or a pointer to any of these types. If the
type name contains whitespace (for example, <literal>struct foo</literal>),
it must be enclosed in single quotation marks or double quotation marks. The
type name may use the backquote (`) scoping operator described under <olink targetptr="syntax-16" remap="internal">Symbol Name Resolution</olink>. If the type is a structured
type, the <command>::print</command> dcmd will recursively print each member
of the struct or union. If the <replaceable>type</replaceable> argument is
not present and a static or global STT_OBJECT symbol matches the address, <command>::print</command> will infer the appropriate type automatically.</para><para>The type argument can be followed by an optional list of <replaceable>member</replaceable> or <replaceable>offset</replaceable> expressions, in which
case only those members and submembers of the specified <replaceable>type</replaceable> are
displayed. Members can be specified using C syntax that includes the array
index operator (<literal>[]</literal>), the structure member operator (<literal>-&gt;</literal>), and the structure pointer operator (<literal>.</literal>). Offsets
can be specified using the MDB arithmetic expansion syntax (<literal>$[]</literal>).After
displaying the data structure, <literal>::print</literal> increments dot by
the size of <replaceable>type</replaceable> in bytes.</para><note><para>The <command>::print</command> dcmd may only be used with objects
that contain compressed symbolic debugging information designed for use with
MDB. This information is only available at present in certain Solaris kernel
modules and user libraries. The <literal>SUNWzlib</literal> decompression
software must be installed in order to process the symbolic debugging information.</para>
</note><para>If the <option>a</option> option is present, the address of each member
is displayed. If the <option>i</option> option is present, the expression
on the left-hand side is interpreted as an immediate value to be displayed
using the specified type. If the <option>p</option> option is present, <command>::print</command> interprets address as a physical memory address instead of a virtual
memory address. If the <option>t</option> option is present, the type of each
member is displayed. If the <option>d</option> or <option>x</option> options
are present, all integers are displayed in decimal (<option>d</option>) or
hexadecimal (<option>x</option>); by default a heuristic is used to determine
if the value should be displayed in decimal or hexadecimal. The number of
characters in a character array that will be read and displayed as a string
can be limited with the <option>c</option> option. If the <option>C</option> option
is present, no limit is enforced. The number of elements in a standard array
that will be read and displayed can be limited with the <option>l</option> option.
If the <option>L</option> option is present, no limit is enforced and all
array elements are shown. The default values for <option>c</option> and <option>l</option> can be modified using <literal>::set</literal> or the <option>o</option> command-line
option as described in <olink targetptr="options-1" remap="internal">Appendix&nbsp;A, Options</olink>. </para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="quit"><command>::quit</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><command>$q</command></secondary>
</indexterm><term><command>::quit</command> [ <option>u</option> ]</term><term><command>$q</command> [ <option>u</option> ]</term><listitem><para>Quit the debugger. When using <command>kmdb</command> only,
the <option>u</option> option causes the debugger to resume execution of the
operating system and unload the debugger. The <option>u</option> option cannot
be used if <command>kmdb</command> was loaded at boot. If the <option>u</option> option
is not present, <command>::quit</command> causes <command>kmdb</command> to
exit to the firmware (on SPARC systems) or causes the system to reboot (on
x86 systems).</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="regs"><command>::regs</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><command>$r</command></secondary>
</indexterm><term>[ <replaceable>thread</replaceable> ] <command>::regs</command></term><term>[ <replaceable>thread</replaceable> ] <command>$r</command></term><listitem><para>Print the general-purpose register set of the representative
thread. If a thread is specified, the general purpose register set of that
thread is displayed.  The thread expression should be one of the thread identifiers
described under <olink targetptr="exec-ctrl-11" remap="internal">Thread Support</olink>.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="release"><command>::release</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary sortas="R"><command>:R</command></secondary>
</indexterm><term><command>::release</command> [ <option>a</option> ]</term><term><command>:R</command> [ <option>a</option> ]</term><listitem><para>Release the previously attached process or core file. If the <literal>-a</literal> option is present, the process is released and left stopped and
abandoned. It can subsequently be continued by <literal>prun(1)</literal> or
it can be resumed by applying MDB or another debugger.  By  default, a released
process is forcibly terminated if it was created by MDB using <command>::run</command>,
or it is released and set running if it was attached to by MDB using the <literal>-p</literal> option or using the <command>::attach</command> or <command>:A
dcmds</command>.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="set"><command>::set</command></secondary>
</indexterm><term><command>::set</command> [ <option>wF</option> ] [ +/-<option role="nodash">o</option> <replaceable>option</replaceable> ]
[ <option>s</option> <replaceable>distance</replaceable> ] [ <option>I</option> <replaceable>path</replaceable> ] [ <option>L</option> <replaceable>path</replaceable> ]
[ <option>P</option> <replaceable>prompt</replaceable> ]</term><listitem><para>Get or set miscellaneous debugger properties. If no options
are specified, the current set of debugger properties is displayed. The <command>::set</command> dcmd recognizes the following options:</para><variablelist><varlistentry><term><option>F</option></term><listitem><para>Forcibly take over the next user process that <command>::attach</command> is
applied to, as if <command>mdb</command> had been executed with the <option>F</option> option
on the command line.</para>
</listitem>
</varlistentry><varlistentry><term><option>I</option></term><listitem><para>Set the default path for locating macro files. The path argument
can contain any of the special tokens described for the <option>I</option> command-line
option in <olink targetptr="options-1" remap="internal">Appendix&nbsp;A, Options</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><option>L</option></term><listitem><para>Set the default path for locating debugger modules. The path
argument can contain any of the special tokens described for the <option>I</option> command-line
option in <olink targetptr="options-1" remap="internal">Appendix&nbsp;A, Options</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><option>o</option></term><listitem><para>Enable the specified debugger option.  If the <literal>+o</literal> form
is used, the option is disabled.  The option strings are described along with
the <option>o</option> command-line option in <olink targetptr="options-1" remap="internal">Appendix&nbsp;A,
Options</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><option>P</option></term><listitem><para>Set the command prompt to the specified prompt string.</para>
</listitem>
</varlistentry><varlistentry><term><option>s</option></term><listitem><para>Set the symbol matching distance to the specified distance.
Refer to the description of the <option>s</option> command-line option in <olink targetptr="options-1" remap="internal">Appendix&nbsp;A, Options</olink> for more information.</para>
</listitem>
</varlistentry><varlistentry><term><option>w</option></term><listitem><para>Re-open the target for writing, as if <command>mdb</command> had
been executed with the <option>w</option> option on the command line.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry><varlistentry><term><command>::showrev</command> [ <option>pv</option> ]</term><listitem><para>Display revision information for the hardware and software
corresponding the current target. If no options are specified, general system
information is displayed. If the <option>p</option> option is present, information
for each load object that is part of a patch is displayed. If the <option>v</option> option
is present, information for each load object is displayed. Load objects without
version information will be omitted from the output for the <option>p</option> option.
Load objects without version information will report <literal>Unknown</literal> in
the output of the <option>v</option> option.</para>
</listitem>
</varlistentry><varlistentry><term><command>::sizeof <replaceable>type</replaceable></command></term><listitem><para>Print the size of the specified type in bytes. The <replaceable>type</replaceable> parameter may name a C struct, union, enum, fundamental integer
type, or a pointer to any of these types. The type name may use the backquote
(<literal>`</literal>) scoping operator described in <olink targetptr="syntax-16" remap="internal">Symbol Name Resolution</olink>. </para><note><para>This dcmd may only be used with objects that contain compressed
symbolic debugging information designed for use with <literal>mdb</literal>.
This information is currently only available for certain Solaris kernel modules.
The SUNWzlib decompression software must be installed in order to process
the symbolic debugging information. </para>
</note>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="stack"><command>::stack</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary><literal>$c</literal></secondary>
</indexterm><term>[<replaceable>address</replaceable>] <command>::stack</command> [<replaceable>count</replaceable>]</term><term>[<replaceable>address</replaceable>] <literal>$c</literal> [<replaceable>count</replaceable>]</term><listitem><para>Print a C stack back trace. If the dcmd is preceded by an
explicit <replaceable>address</replaceable>, a back trace beginning at this
virtual memory address is displayed. Otherwise, the stack of the representative
thread is displayed. If an optional count value is given as an argument, no
more than <replaceable>count</replaceable> arguments are displayed for each
stack frame in the output.</para><note arch="sparc" wordsize="bits64"><para><indexterm><primary>stack bias</primary></indexterm>The biased frame pointer value (that is, the virtual address minus <literal>0x7ff</literal>) should be used as the address when requesting a stack trace.</para>
</note>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="stackinfo"><command>::stackinfo</command></secondary>
</indexterm><term>[<replaceable>address</replaceable>] <command>::stackinfo</command> [<option>h</option>|<option>a</option>]</term><listitem><para>Display <structname>kthread_t</structname> stack usage. (The <command>::stackinfo</command> dcmd is available starting with SXCE build 102.)</para><para>Shows the real utilization of the kernel stack if the <filename>/etc/system</filename> <literal>kmem_stackinfo</literal> tunable (an unsigned integer)
is nonzero at kthread creation time. For example:</para><programlisting>          THREAD            STACK   SIZE  CUR  MAX CMD/LWPID
ffffff014f5f2c20 ffffff0004153000   4f00   4%  43% init/1</programlisting><para>The current stack size utilization for this kthread is 4% of its maximum
size. The stack size utilization for this kthread has been up to 43% of its
maximum size. Stack size is 4f00 bytes.</para><itemizedlist><para>The MAX value can be shown as n/a (not available) in the following cases:</para><listitem><para>For the very first kthread (sched/1)</para>
</listitem><listitem><para>If <literal>kmem_stackinfo</literal> was zero at kthread creation
time</para>
</listitem><listitem><para>If the kthread has not yet run</para>
</listitem>
</itemizedlist><para>The <option>a</option> option shows TS_FREE kthreads (interrupt kthreads).
The <option>h</option> option shows history (dead kthreads that used their
kernel stack the most).</para><para>If the <filename>/etc/system</filename> <literal>kmem_stackinfo</literal>
tunable is nonzero, then the DTrace probe
<literal>sdt:genunix:stkinfo_end:stack-usage</literal> is activated for dead
kthreads as follows:</para><informaltable frame="none"><tgroup cols="3" colsep="0" rowsep="0"><colspec colwidth="10*"/><colspec colwidth="20*"/><colspec colwidth="75*"/><tbody><row><entry><para>arg0</para>
</entry><entry><para><literal>kthread_t *</literal></para>
</entry><entry><para>A dead kthread</para>
</entry>
</row><row><entry><para>arg1</para>
</entry><entry><para><structname>size_t</structname></para>
</entry><entry><para>The kernel stack size of the dead kthread</para>
</entry>
</row><row><entry><para>arg2</para>
</entry><entry><para><structname>size_t</structname></para>
</entry><entry><para>A percentage that is the maximum use of the kernel stack for this dead
kthread</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>If the <filename>/etc/system</filename> <literal>kmem_stackinfo</literal>
tunable is nonzero, then the performance of creating and deleting kthreads is
decreased.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="status"><command>::status</command></secondary>
</indexterm><term><command>::status</command></term><listitem><para>Print a summary of information related to the current target.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>cpuid</replaceable> <command>::switch</command></term><term><replaceable>cpuid</replaceable> <command>:x</command></term><listitem><para>When using <command>kmdb</command> only, switch to the CPU
indicated by the specified <replaceable>cpuid</replaceable> and use this CPU's
current register state as the representative for debugging.</para>
</listitem>
</varlistentry><varlistentry><term><command>::term</command></term><listitem><para>Print the name of the terminal type that MDB is using to perform
any terminal-dependent input and output operations, such as command-line editing.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>thread</replaceable> <command>::tls</command> <replaceable>symbol</replaceable></term><listitem><para>Print the address of the storage for the specified thread-local
storage (TLS) symbol in the context of the specified thread. The thread expression
should be one of the thread identifiers described under <olink targetptr="exec-ctrl-11" remap="internal">Thread Support</olink>. The symbol name may use any
of the scoping operators described under <olink targetptr="syntax-16" remap="internal">Symbol
Name Resolution</olink>. </para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="typeset"><command>::typeset</command></secondary>
</indexterm><term><command>::typeset</command> [+/-<option role="nodash">t</option>] <replaceable>variable-name</replaceable> ...</term><listitem><para>Set attributes for named variables. If one or more variable
names are specified, they are defined and set to the value of dot. If the <option>t</option> option is present, the user-defined tag associated with each variable
is set. If the <option role="plus">t</option> option is present, the tag is
cleared. If no variable names are specified, the list of variables and their
values is printed.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="unload"><command>::unload</command></secondary>
</indexterm><term><command>::unload</command> <replaceable>module-name</replaceable></term><listitem><para>Unload the specified dmod. The list of active dmods can be
printed using the <command>::dmods</command> dcmd. Built-in modules cannot
be unloaded. Modules that are busy (that is, provide dcmds that are currently
executing) cannot be unloaded.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="unset"><command>::unset</command></secondary>
</indexterm><term><command>::unset</command> <replaceable>variable-name</replaceable> ...</term><listitem><para>Unset (remove) the specified variables from the list of defined
variables. Some variables are exported by MDB are marked as persistent, and
cannot be unset by the user.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="vars"><command>::vars</command></secondary>
</indexterm><term><command>::vars</command> [<option>npt</option>]</term><listitem><para>Print a listing of named variables. If the <option>n</option> option
is present, the output is restricted to variables that currently  have non-zero
values. If the <option>p</option> option is present, the variables are printed
in a form suitable for re-processing by the debugger using the <command>$&lt;</command> dcmd.
This option can be used to record the variables to a macro file, then restore
these values later. If the <option>t</option> option is present, only the
tagged variables are printed. Variables can be tagged using the <option>t</option> option
of the <command>::typeset</command> dcmd.</para>
</listitem>
</varlistentry><varlistentry><term><command>::version</command></term><listitem><para><indexterm><primary>dcmds</primary><secondary sortas="version"><command>::version</command></secondary></indexterm>Print the debugger version number.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="vtop"><command>::vtop</command></secondary>
</indexterm><term><replaceable>address</replaceable> <command>::vtop [<option>a</option> <replaceable>as</replaceable>]</command></term><listitem><para>Print the physical address mapping for the specified virtual
address, if possible. The <command>::vtop</command> dcmd is only available
when examining a kernel target, or when examining a user process inside a
kernel crash dump (after a <command>::context</command> dcmd has been issued).</para><para>When examining a kernel target from the kernel  context, the <option>a</option> option
can be used to specify the address (<replaceable>as</replaceable>) of an 
alternate  address  space  structure  that should  be  used  for the virtual
to physical translation. By default, the kernel's address space  is  used
for  translation.  This option is available for active address spaces even
when the dump  content  only  contains kernel pages. </para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="walk"><command>::walk</command></secondary>
</indexterm><term>[ <replaceable>address</replaceable> ] <command>::walk</command> <replaceable>walker-name</replaceable> [ <replaceable>variable-name</replaceable> ]</term><listitem><para>Walk through the elements of a data structure using the specified
walker. The available walkers can be listed using the <command>::walkers</command> dcmd.
Some walkers operate on a global data structure and do not require a starting
address. For example, walk the list of <structname>proc</structname> structures
in the kernel. Other walkers operate on a specific data structure whose address
must be specified explicitly. For example, given a pointer to an address space,
walk the list of segments. </para><para>When used interactively, the <command>::walk</command> dcmd will print
the address of each element of the data structure in the default base. The
dcmd can also be used to provide a list of addresses for a pipeline. The walker
name can use the backquote &ldquo; <literal>`</literal> &ldquo; scoping operator
described in <olink targetptr="syntax-13" remap="internal">Dcmd and Walker Name Resolution</olink>.
If the optional <replaceable>variable-name</replaceable> is specified, the
specified variable will be assigned the value returned at each step of the
walk when MDB invokes the next stage of the pipeline.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="walkers"><command>::walkers</command></secondary>
</indexterm><term><command>::walkers</command></term><listitem><para>List the available walkers and print a brief description for
each one.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="whence"><command>::whence</command></secondary>
</indexterm><indexterm><primary>dcmds</primary><secondary sortas="which"><command>::which</command></secondary>
</indexterm><term><command>::whence</command> [<option>v</option>] <replaceable>name</replaceable> ...</term><term><command>::which</command> [<option>v</option>] <replaceable>name</replaceable> ...</term><listitem><para>Print the dmod that exports the specified dcmds and walkers.
These dcmds can be used to determine which dmod is currently providing the
global definition of the given dcmd or walker. Refer to <olink targetptr="syntax-13" remap="internal">Dcmd and Walker Name Resolution</olink> for more information
on global name resolution. The <option>v</option> option causes the dcmd to
print the alternate definitions of each dcmd and walker in order of precedence.</para>
</listitem>
</varlistentry><varlistentry><indexterm><primary>dcmds</primary><secondary sortas="xdata"><command>::xdata</command></secondary>
</indexterm><term><command>::xdata</command></term><listitem><para>List the external data buffers exported by the current target.
External data buffers represent information associated with the target that
cannot be accessed through standard target facilities (that is, an address
space, symbol table, or register set). These buffers can be consumed by dcmds;
for more information, refer to <olink targetptr="api-52" remap="internal">mdb_get_xdata()</olink>.</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
</chapter><?Pub *0000064733 0?>