[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 3

kdb Command

Purpose

Displays system images for examining a dump.

Syntax

kdb [ SystemImageFile [ KernelFile]]

Description

The kdb command is an interactive utility for examining an operating system image or the running kernel. The kdb command interprets and formats control structures in the system and provides miscellaneous functions for examining a dump.

The SystemImageFile parameter specifies the file that contains the system image. The default SystemImageFile is /dev/pmem.

The KernelFile parameter contains the kernel symbol definitions. The default for the KernelFile is /unix.

Root permissions are required for execution of the kdb command on the active system. This is required because the special file /dev/pmem is used. To run the kdb command on the active system, type:

kdb

To invoke the kdb command on a system image file, type:

kdb SystemImageFile

where SystemImageFile is either a file name or the name of the dump device. When invoked to view data from a SystemImageFile the kdb command sets the default thread to the thread running at the time the SystemImageFile was created.

Notes:
  1. When using the kdb command a kernel file must be available.
  2. Stack tracing of the current process on a running system does not work

Subcommand Arguments

The following table describes the most common argument types referenced in the subcommand syntax diagrams that follow.

Argument Description
* A wildcard used to select all entries.
- Used to turn page scrolling on or off. It is used with the setup subcommand at the kdb command prompt.
count A hex constant specifying the number of times to perform a specific operation.
cpu A decimal value specifying a cpu number in a SMP machine.
eaddr Effective address. This may be a hex constant or an expression.
paddr A physical address.
pid A hex constant or expression specifying a process ID.
selection Indicates that a menu is displayed from which a selection must be made.
slot A decimal constant specifying a slot number within a table.
symb A symbolic reference to a value. Symbols from the kernel or kernel extensions or both may be used.
tid A hex constant or expression specifying a thread ID.
tslot A decimal constant specifying a slot number within the thread table.

Commands in kdb

The following lists the subcommands available within the kdb command. Refer to the Subcommands for the KDB Kernel Debugger and kdb Command in the AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts for more detailed information, including examples, on the subcommands.

kdb allows output redirection of these subcommands via the operators "|", ">" and ">>". The "|" symbol pipes all output of the command before the symbol, to the input of the command after the symbol. The ">" operator writes the output of the command preceding the operator to the file name following the operator; any existing file is overwritten. The ">>" operator appends the output of the command preceding the operator to the file name following the operator.

This output redirection feature is applicable only to the kdb command, and not to the KDB Kernel Debugger.

The following subcommand descriptions are grouped into the functional sets:

Basic subcommands

alias [ aliasname [ =Comand String ] ] This command defines or displays aliases. It also creates or redefines alias definitions or writes existing alias definitions to standard output.
h Display a list of commands with short descriptions.
his [?] [count] The hist command prints history commands.
e Exits from the kdb command. This is also recognized by the e subcommand alias.
set [toggle | count] The setup subcommand lists and manipulates kdb toggles.
f [+x|-x][tslot | eaddr] Displays a stack trace for the current or specified thread.
ctx [cpu] The context command is used to switch to kdb context for a CPU. With no argument, the kdb command returns to using the current context.
cdt [cdt_number [cdt_entry]] The cdt command is used display information about Component Dump Tables (CDTs) or view the data for a component dump entry for a dump.
print [-l <offset> | <name> [-e <end_val>][<type>] <address> [-a <count>] [<type>] <address> Helps in interpreting a dump of memory by formatting it into a given C language data structure and displaying it.

Memory display and disassembly subcommands

d symb|eaddr [count] Display data in byte format.
dw symb|eaddr [count] Display data in word format.
dd symb|eaddr [count] Display data in double word format.
dp paddr [count] Display data in byte format.
dpw paddr [count] Display data in word format.
dpd paddr [count] Display data in double word format.
dc symb|eaddr [count] Display disassembled instruction
dpc paddr [count] Display disassembled instruction
dr [gp|sr|sp|reg_name] Display registers. Argument gp displays all general purpose registers, sr displays all segment register, and sp displays all special purpose registers. A specific register may be displayed by name.
di [hexadecimal instr] Decode the given hexadecimal instruction word with the opcode and the operands.
find [-s] symb|eaddr pattern [mask [delta]] Find a pattern. The -s option indicates that pattern is a string, instead of a hex value.
findp [-s] paddr pattern [mask [delta]] Find a pattern. The -s option indicates that pattern is a string, instead of a hex value.
ext [-p] eaddr delta [size [count]] The ext subcommand displays size words starting at eaddr, then increments by delta words and displays size words again. This continues until count loops are done. The -p flag indicates that delta is not the increment value, but the offset to a pointer to the next memory location.
extp [-p] paddr delta [size [count]] The ext subcommand displays size words starting at eaddr, then increments by delta words and displays size words again. This continues until count loops are done. The -p flag indicates that delta is not the increment value, but the offset to a pointer to the next memory location.

Symbol subcommands

nm symb Translate a symbol to an effective address.
ns The ns toggle may be used to enable/disable symbol translation.
ts eaddr Translate an effective address to a symbol.
which symbol | addr Displays the name of the kernel source file containing symbol or addr.
nm symb Translate a symbol to an effective address.
ns The ns toggle may be used to enable/disable symbol translation.
ts eaddr Translate an effective address to a symbol. Display

Calculator subcommands

hcal hex_expr The hcal command may be used to convert hexadecimal values to decimal.
dcal decimal_expr The dcal command may be used to convert decimal values to hexadecimal.

Machine status subcommands

stat Display status information for a dump file.
switch [ [tslot|eaddr] | [u|k] ] Switch the context to a particular thread or between user and kernel address space.
symptom [-e] Display the symptom string for a dump. It is not valid on a running system.

Loader subcommands

lke [?] [-l] [slot|symb|eaddr] Display information on loaded extensions.
stbl [slot|symb|eaddr] Display loaded symbol tables.
rmst slot|symb|eaddr Remove a symbol table.
exp [symb] The exp command may be used to look for an exported symbol address or to display the export list.

Process subcommands

ppda [*|cpu|symb|eaddr] Display per processor data areas.
intr [slot|symb|eaddr] Display interrupt handler tables.
mst [tslot|symb|eaddr] Display machine state save areas (mst).
p [*| - | slot|symb|eaddr] Display process table entries.
th [*| - | slot|symb| eaddr|-w state] Display thread table entries.
ttid [tid] Display detailed data for a thread table entry.
tpid [pid] Display summary information about each thread associated with a specified process.
rq [bucket|symb|eaddr] Display run queues.
sq [bucket|symb|eaddr] Display sleep queues.
lq [bucket|symb|eaddr] Display lock queues.
u [-64][tslot|symb|eaddr] Display the u-block for a thread.

LVM subcommands

pbuf [*] symb|eaddr Display physical buffer information.
volgrp symb|eaddr Display volume group information.
pvol symb|eaddr Display physical volume information.
lvol symb|eaddr Display logical volume information.

SCSI subcommands

ascsi [slot|symb|eaddr] Display SCSI adapter information.
vscsi [slot|symb|eaddr] Display virtual SCSI information.
scdisk [slot|symb| eaddr] Display SCSI disk information.

Memory allocation subcommands

hp [symb|eaddr] Display kernel heap information.
xm [-?] Display heap debug information.
kmbucket [?] [-l] [-c cpu] [-i index][addr] Display kernel memory allocator bucket information.
kmstats [symb|eaddr] Display kernel allocator memory statistics.

File system subcommands

buf [slot|symb|eaddr] Display buffer cache headers.
hb [bucket|symb|eaddr] Display the buffer cache hash list of headers.
fb [bucket|symb|eaddr] Display the buffer cache freelist of headers.
gno symb|eaddr Display data for a generic node structure.
gfs symb|eaddr Display data for a generic file system structure.
file [slot|symb|eaddr] Display the file table.
ino [slot|symb|eaddr] Display the inode table. Only used inodes are printed. Unused inodes may be printed with the fino subcommand.
hino [bucket|symb|eaddr] Display inode hash lists.
fino [slot|symb|eaddr] Display inode (used and unused) cache list entries.
rno symb|eaddr Display data for a remote node structure.
cku symb|eaddr Display data for a client kudp private structure.
vno symb|eaddr Display data for a virtual node structure.
vfs [slot|symb|eaddr] Display data from the virtual file system table.
specno symb|eaddr Display special device nodes data.
devno [slot|symb|eaddr] Display device node table information.
fifono [slot|symb|eaddr] Display fifo node table information.
hno [bucket|symb|eaddr] Display hash node table information.

System table subcommands

var Display the var structure and the system configuration of the machine.
dev [symb|addr|major] Display the device switch table.
trb Display timer request blocks.
slk [symb|eaddr] Display data for simple locks.
clk [symb|eaddr] Display data for complex locks.
ipl [*|cpu] Display processor information table data.
trace [-h] [hook[:subhook]]... [#data]... [-cchannel] Display data from kernel trace buffers.
trace -K [-j event1, eventN | -k event1, eventN] Display data in the trace buffers collected through the trcstart subcommand.
trcstart -[f | l] -j event1, eventN -k event1, eventN -p Start the system trace through kdb.
trcstop Stop the system trace started through kdb.

Network subcommands

ifnet Display interface information.
tcb [slot|symb|eaddr] Display data for TCP blocks.
udb [slot|symb|eaddr] Display data for UDP blocks.
sock [tcp|udp] [symb|eaddr] Display socket information.
sockinfo [ socket | inpcb | unpcb | rawcb | ribcb | tcpcb ] Display Socket Information by type and address.
tcpcb [tcp|udp] [symb|eaddr] Display TCP control blocks.
mbuf [tcp|udp] [symb|eaddr] Display TCP/UDP message buffers.
ndd [symb|eaddr] Display network device driver statistics.
netstat [-n] [-D] [-c] [-P] [-m | -s | -ss | -u | -v] [{-A -a} | {-r -C -i -I Interface}] [-f AddressFamily] [-p Protocol] [-Zc | -Zi | -Zm | -Zs] [Interval] [System] Display network status.

VMM subcommands

vmker Display virtual memory kernel data.
rmap [*] [slot] Display the real address range mapping table.
pfhdata Display the virtual memory control variables.
vmstat Display virtual memory statistics.
vmaddr Display virtual memory control structure addresses.
pdt [*] [slot] Display the paging device table.
scb [selection] Displays VMM segment control blocks.
pft [selection] Display VMM page frame table data.
pte [selection] Display VMM page table entries.
pta [?] Display VMM PTA segment information.
ste [-p pid] Display segment table entry information for 64-bit processes.
sr64 [-p pid] [esid [count]] Display segment registers for 64-bit processes.
segst64 [-p pid] [-e esid] [-s flag] [fno|shm Display segment state information for 64-bit processes.
apt [selection] Display alias page table information.
vmwait [symb|eaddr] Display VMM wait status information.
ames [selection] Display address map for a specified process.
zproc Display information about the VMM zeroing kproc.
vmlog Display the current VMM error log entry.
vrld Display the VMM reload xlate table. This information is only used on SMP PowerPC machines, to prevent VMM reload dead-lock.
ipc [selection] Display interprocess communication facility information.
lka [slot|symb|eaddr] Display VMM lock anchor data.
lkh [slot|symb|eaddr] Display VMM lock hash list entries.
lkw [slot|symb|eaddr] Display information about VMM lock words.
vmdmap [slot|symb|eaddr] Display VMM disk map information.
vmlocks Display VMM spin locks.

Examples

The following examples demonstrate invocation options for the kdb command

  1. To invoke the kdb command with the default system image and kernel image files, type:

    kdb

    The kdb program returns a (0)> prompt and waits for entry of a subcommand.

  2. To invoke the kdb command using a dump file named /var/adm/ras/vmcore.0 and the UNIX kernel file named /unix, type:

    kdb /var/adm/ras/vmcore.0 /unix

    The kdb program returns a (0)> prompt and waits for entry of a subcommand.

The following examples demonstrate usage of selected kdb commands:

  1. To run the deadlock analysis subcommand, type:

    (0)> dla
  2. To display the third entry in the vfs table, type:

    (0)> vfs 3
  3. To display a list of vnodes, type:

    (0)> vnode

Files

/usr/sbin/kdb Contains the kdb command.
/dev/pmem Default system image file
/unix Default kernel file

Related Information

KDB Kernel Debugger and kdb Command in the AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

Subcommands for the KDB Kernel Debugger and kdb Command in the AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

Memory Overlay Detection System (MODS) in the AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]