Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ kdb(1M) — Motorola System V 88k Release 4 Version 4.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

kdb(1M)  —  ADMINISTRATOR COMMANDS

NAME

kdb − kernel debugger (with multi-processor support)

DESCRIPTION

The kernel debugger is a simple debugger that resides in the UNIX kernel and allows the programmer to examine and modify memory, disassemble instructions, download and execute programs, set breakpoints, and single-step instructions, on all the on-line processors. 

You can configure the kernel debugger as part of the kernel load file (/stand/unix).  Type the string "@@P" (configurable in the kdb master file) on the console or push the software abort button to enter the debugger. 

Multi-processor Support

The kernel debugger allows each processor independently to be either in the debugger or running at any time.  Processors in the debugger are in one of two modes: master mode or slave mode.  At most one processor is in master mode at any time, although master mode may be transferred among the processors with a debugger command described below.  When any processor enters the debugger from a state in which all processors are running, that processor becomes the master and forces all the other processors to become slaves, thereby suspending execution over the entire multi-processor system.  All the commands described below execute on the current master processor unless otherwise noted.  Slave processors do nothing until instructed by the master as a result of a debugger command. 

Commands

All debugger commands are brief mnemonics (usually two characters) followed by zero or more arguments.  In the following descriptions, optional arguments are enclosed in square brackets.  Arguments are separated by spaces or commas, and each argument must be one of the following:

1.  A number in the current input radix (default hexadecimal), or in a ­different radix as specified by a prefix: 0x for hex, 0t for decimal, 0o for octal, or 0b for binary. 

2.  A percent sign followed by a register name, meaning the contents of that register, such as %r4, %r13, %sxip. 

3.  A percent sign followed by b and an instruction breakpoint number, meaning the address referred to by that breakpoint, such as %bx. 

4.  A dollar sign, meaning the address of the last memory location that was displayed. 

5.  The name of a kernel symbol.  This works only if the kernel debugger has been loaded with the UNIX symbol table by using the dbsym(1M) command.  A sharp (#) prefix to a name forces the interpretation as a symbol, and not a hex number.  (Without this, the name add for example would always be interpreted as 0xADD.) 

6.  The name of a user-defined debugger variable. 

7.  Any of the above combined by using the usual arithmetic operators (+ - ∗ / & | ^), the relational operators used in the C programming language (== != <> <= >=), or the C language pointer-dereference operator (∗).  Two special operators perform instruction arithmetic: A @− B backs up B instructions from address A; A @+ B advances B instructions from address A; where A and B are expressions.  All operators have equal precedence.  Use parentheses to force a particular order of evaluation.  Division by zero yields zero. 

8.  A string surrounded by single- (’) or double-quotes (").  The C escape for the newline character (\n) may be used in the string. 

9.  A percent sign followed by s and an expression, meaning the NULL-terminated character string starting at that memory address. 

10.  A percent sign followed by p and an expression, meaning the physical memory address corresponding to that virtual address. 

11.  A percent sign followed by v and an expression, to test that virtual address’ validity.  If the virtual address is valid, this operation evaluates to 1, otherwise to 0. 

12.  A percent sign followed by a 1, 2, or 4 and an expression, meaning a one, two, or four byte pointer-dereference. 

13.  Any numeric expression preceded by ~, meaning the ones-complement of the number. 

Input Commands

The multi-processor debugger prompts with Kn> , where n is the processor identification number (cpuid) of the current master processor, in hex.  The single-processor debugger prompts with K>.  This prompt indicates that the debugger is ready to accept any of the commands described below.  Input characters can be erased with BACKSPACE or DEL.  An entire input line can be erased with CTRL-U or CTRL-X.  In addition, the debugger supports flow control (CTRL-S, CTRL-Q) and keyboard interrupt (CTRL-C). 

On a multi-processor system, before each time the debugger issues a prompt, it checks the state of each processor and notifies the user of those processors that have entered slave mode since the last check.  In this way, the user is kept informed of the activities on all the processors. 

After a breakpoint or debug trap, the debugger prints a status line describing the trap, immediately followed by the debugger prompt, and is again ready to accept commands.  In the case of a trace trap, the debugger automatically supplies the expected command, tr.  If you want to enter a different command, erase the tr and retype a new command. 

During any of the display, modify, examine or write commands, you can enter one of the following:

RETURN
Moves to the next item.

+n Moves to the nth next item. 

− Moves to the previous item. 

−n Moves to the nth previous item. 

=addr
Moves to the item at address addr.  Only valid when operating on memory, not on registers. 

n Changes the value of the item to n.  Only valid for modify or write commands, not display or examine.  The mi command allows you to enter multiple numbers separated by spaces, to change more than one byte. 

. (Or any character other than + - = or a hex number.)  Exits the command and returns to the debugger prompt. 

If ever an attempt is made to access an invalid virtual address, the command and all levels of invoked macros will be aborted and the debugger will prompt for the next command. 

Display Commands

These commands allow you to examine memory only.  This prevents accidental modification of system memory when in the debugger. 

dw addr [ count ]
Displays memory as words (4 byte hex integers), 32 bytes at a time. If a count is given, memory is displayed 32 ∗ count bytes at a time. 

dh addr [ count ]
Displays memory as half words (2 byte hex integers), 32 bytes at a time.

db addr [ count ]
Displays memory as bytes (1 byte hex integers), 32 bytes at a time.

di [ addr ]
Displays memory as disassembled instructions. The default addr is the contents of SXIP on the 88100 platform and the contents of EXIP on the 88110 platform. 

dr [ addr ]
Displays the CPU general registers stored at addr.  The default addr is the automatically-determined register save area (see the rg command). 

dR Displays the CPU “special” registers (shadow, control, supervisor, data pipe-line, cache control, and root pointers)

df Displays the CPU floating point registers. 

dy addr [ count ]
Similar to dw, but displays the longs in symbolic form, if possible. 

se start end pattern [ mask ]
search start end pattern [ mask ] Searches for the given pattern in the range of addresses starting at start, up to (but not including) end.  The search is performed on words (4 bytes).  If a mask is given, only those bits corresponding to 1 bits in the mask are significant in the search. 

label [ start ]
Searches for symbolic labels which are operands to branch instructions. If start is given, the search begins at the given address; if start is not given, the search begins at the current SXIP on the 88100 platform and the current EXIP on the 88110 platform. 

Examine Commands

ew addr
Examines memory as words, one at a time.

eh addr
Examines memory as half words, one at a time.

eb addr
Examines memory as bytes, one at a time.

ei [ addr ]
Examines memory as disassembled instructions. (Same as di.) 

er Examines CPU general registers, one at a time. 

eR Examines the CPU special registers, one at a time. 

ef Examines the floating point registers, one at a time. 

Modify Commands

mw addr
Examines and optionally modifies memory, as words.

mh addr
Examines and optionally modifies memory, as half words.

mb addr
Examines and optionally modifies memory, as bytes.

mi [ addr ]
Examines memory as instructions and optionally modifies (as bytes).

mr Examines and optionally modifies the CPU registers. 

mR Examines and optionally modifies the CPU special registers. 

mf Examines and optionally modifies the floating point registers. 

Write Commands

ww addr
Writes memory as words, without examining.

wh addr
Writes memory as half words, without examining.

wb addr
Writes memory as bytes, without examining.

Execute Commands

go [ addr ]
Resumes execution on all processors. If an addr is given, the master processor resumes execution at addr. 

gos [ cpuid ... ]
Resumes execution on only the processors whose cpuid’s are listed.  If no cpuid’s are given, it resumes execution on only the current master processor. 

tr [ addr ]
Trace: single-step one instruction on the master processor. If an addr is given, the master processor resumes execution at addr. 

trs [ cpuid ]
Trace (single step) on the slave processor identified by cpuid, or on the master processor if cpuid is omitted. 

to [ addr ]
Trace over: single step over “call” instructions on the master processor. If an addr is given, the master processor resumes execution at addr. 

tos [ cpuid ]
Trace (single step) over “call” instructions on the slave processor identified by cpuid, or on the master processor if cpuid is omitted. 

stop [ cpuid ... ]
Suspend execution on the running processors whose cpuid’s are listed, and force them into slave mode.  If no cpuid’s are given, it suspends every currently running processor. 

call addr [ args ... ]
Call a function with the specified arguments and show the return value.

Instruction Breakpoint Commands

An instruction breakpoint invokes the debugger just prior to the execution of a specified instruction.  There are a total of sixteen instruction breakpoints available.  Instruction breakpoints affect all processors; that is, every processor that hits an instruction breakpoint will enter the debugger. 

br [ addr ]
Sets an instruction breakpoint. The default address is the contents of SXIP on the 88100 platform and the EXIP on the 88110 platform. 

bc [ addr ]
Clears (removes) an instruction breakpoint.

bC Clears (removes) all instruction breakpoints. 

bx [ addr ]
Sets a temporary (one-shot) instruction breakpoint.

bo [ addr ]
Turns an instruction breakpoint on or off. If a breakpoint is turned off, it acts as though it were cleared, but the breakpoint remains in the breakpoint table.

bp Displays instruction breakpoints. 

Data Breakpoint Commands

A data breakpoint invokes the debugger when a specified memory location is modified. Data Breakpoints are implemented only on 88110 platforms, where two data breakpoint registers are available.  While all of the data breakpoint commands are capable of covering a range of addresses, it should be noted that hardware limitations may require altering the requested range.  In such cases, KDB will output an advisory message with the new range. 

ur addr1 [ addr2 ]
Sets a read data breakpoint at addr1 through addr2.  The default for addr2 is addr1. 

uw addr1 [ addr2 ]
Sets a write data breakpoint at addr1 through addr2.  The default for addr2 is addr1. 

urw addr1 [ addr2 ]
Sets a read/write data breakpoint at addr1 through addr2.  The default for addr2 is addr1. 

urx addr1 [ addr2 ]
Sets a temporary read data breakpoint at addr1 through addr2.  The default for addr2 is addr1. 

uwx addr1 [ addr2 ]
Sets a temporary write data breakpoint at addr1 through addr2.  The default for addr2 is addr1. 

urwx addr1 [ addr2 ]
Sets a temporary read/write data breakpoint at addr1 through addr2.  The default for addr2 is addr1. 

uc num
Clears a data breakpoint.

uC Clears all data breakpoints. 

up Prints all data breakpoints. 

Miscellaneous Commands

cpu cpuid
Switch master mode from the current master processor to the slave processor identified by cpuid.  The current master processor becomes a slave, and the designated slave becomes the new master. 

ss [ cpuid ]
Show the multi-processor debugger status of the processor identified by cpuid, or of all processors if cpuid is omitted. 

bt [ pc ] [ sp ]
Displays a stack backtrace, using sp as the stack pointer and pc as the program counter.  The default stack pointer is the contents of register r31.  The default program counter is the contents of the SXIP register on the 88100 platform and the EXIP register on the 88110 platform.  If pc and sp are specified, the return address for the first routine must be already saved on the stack. 

fill start end value
Fills memory from address start up to (but not including) address end with the byte value. 

pf “string” [ args ... ]

printf “string” [ args ... ]
Prints the string. Percent signs in the string are treated as in printf(3S): %d, %u, %x, %o, %b, %s, %c are supported.  In addition, %y prints its argument in symbolic form, if possible, and %I prints its argument in disassembled instruction form. 

rg [ addr ]
Changes the pointer to the “register save area,” from which all references to CPU registers retrieve registers. Normally, the register save area is set up automatically, but you can use a different set of registers when you use rg to change the pointer.  To restore the pointer to its original value, use an addr of zero.  If addr is missing, it displays the current register save area pointer. 

pg [ n ] [ s ]
If n is 0, turns paging off.  If n is 1, turns paging on.  If n is missing, it simply reports whether paging is on or off.  If paging is off, the debugger interprets all addresses as physical addresses.  If paging is on, addresses are interpreted as linear (virtual) addresses.  (Breakpoints are always linear addresses.)  If s is present, the command is silent. 

su [ n ]
If n is 0, turns user area addressing off.  If n is 1, turns user area addressing on.  If n is missing, it simply reports whether user area addressing is on or off.  If user area addressing is off, the debugger interprets all addresses as supervisor area addresses.  If user area addressing is on, addresses are user area addresses. 

ma addr

map addr
Displays the page directory and page table entries used to map the given linear address to a physical address. This behaves the same whether paging is on or off.

root [ addr ]
Uses the specified supervisor area descriptor for translating linear-to-physical addresses. This address is obtained from the MMU if no root command is given.  To restore the base to that original value, use an addr of zero.  If addr is missing, it displays the current supervisor area descriptor. 

sp [ addr ]
addr must be the address of a kernel proc structure.  The debugger uses the context of that process to translate linear-to-physical addresses for the u page and user area addresses.  Use of the sp command overrides the MMU. 

radix [ n ]
Set the input radix to n.  If n is omitted, it displays the current input radix.  The default radix is hexadecimal. 

pr addr [ radix ]
Prints the value of the address given as an argument in the specified radix, or in the current input radix if radix is missing.  This is most useful if addr is an expression (see the earlier discussion of arguments). 

printbits “bit-desc” word
Display the bits that are set (the 1 bits) in word symbolically according to bit-desc, which is a colon-separated list of names associated with the corresponding bit positions, starting with bit 0 (the least significant bit).  For example, printbits “X:Y:Z:FOO:BAR” 0x9D prints X Y Z FOO BAR. 

ds addr
Prints the value of the address as an offset from the nearest symbol.

sy [ n ] [ max ]
If n is 0, turns symbolic display off.  If n is 1, turns symbolic display on.  If n is missing, it simply reports whether symbolic display is on or off.  If max is given, it specifies the maximum offset for printing symbols.  For example, if max is 0x2000, a symbol may be displayed in the form name + NNN, where NNN is 1 through 0x2000, but if NNN would be greater than 0x2000, the non-symbolic display format is used. 

more [ lines ]
Sets the number of display lines to lines.  If lines is greater than zero, it enables output paging.  When lines or more contiguous lines of information are printed without asking the user for input, the message --press space for more-- is displayed and output is temporarily suspended until the user presses the space bar.  This prevents the debugger from printing too many lines of output at once on video terminals.  If lines is zero, it disables output paging.  Output paging is disabled by default.  If lines is missing, it reports whether output paging is enabled or disabled. 

pause
Pause until the user types something.

he or help or ? or ??
Lists the debugger commands.

ve Prints the version number of the debugger. 

# or ## or no
No-op. Input lines beginning with # are treated as comments and ignored.

Debugger Variable Commands

These commands manipulate variables the user defines.  User-defined debugger variables may be used in expressions just like kernel symbols. 

set var value
Set the variable named by var to have the given value.  If the variable var has not previously been defined, it becomes defined; if it was previously defined, its old value is lost. 

read var
Read an expression from the user and set the named debugger variable to the expression’s value.

Macro Commands

define “name” [ arg-desc ] [ maxsize ]
Defines a macro, with the given name and the specified argument description string. The optional maxsize argument specifies the maximum size (in bytes) of the macro; the default size is 4096 bytes.  The macro can be invoked after its definition by simply typing its name like any other command.  The arg-desc string describes to the debugger what arguments the macro expects: each lower-case letter specifies the type of the corresponding argument, as follows:

a or i address or integer, the result of an arbitrary expression

s string

? means the following arguments are optional

∗ means any number of arguments or any type

. means don’t parse more arguments

, is ignored. 

For example, the argument description for the se command is “aai?i”, and for pf it is “s∗”.  If arg-desc is missing, the macro will be defined as requiring no arguments.  After you enter the dm command, the debugger prompts with mac> for the body of the macro.  Any debugger commands can be entered as the body of the macro, although interactive commands, such as di are not recommended (see the interact command).  The expression $n, where n is a digit from 1 to 9, is replaced on invocation with the nth argument to the macro.  The expression $# evaluates to the number of arguments to the macro.  Entry of the macro body is terminated by a period (.) anywhere in the macro body.  Include a period in the macro body by preceding the character with a backslash (\). 

dm “name” arg-count [ maxsize ]
[Note: The dm command is obsolete; use define instead.] Defines a macro, with the given name and the specified number of arguments.  The optional maxsize argument specifies the maximum size (in bytes) of the macro; the default size is 4096 bytes.  The cm command (described below) can be used subsequently to invoke the macro. 

cm “name” [ args ... ]
[Note: The cm command is obsolete; instead simply type the name of the macro as if it were a normal debugger command.] Calls a macro.  The number of arguments must match the number given when the macro was defined.  The effect is as if the body of the macro were entered in place of the cm command. 

em “name”

delm “name”
Erases (deletes) the named macro.

lm [ “name” ]
Lists the named macro. If the macro name is omitted, lists all macros.

nx Repeats the call to the previously invoked macro.  The arguments used are those used on the previous call, possibly modified by any intervening sa commands. 

sa n value

setarg n value
Sets the nth macro argument to the given value.  The value of n should be between 1 and 9.  Useful within a macro to set up the arguments for the next call through an nx command. 

args n
Sets the number of macro arguments to n. 

ec [ n ]

echo [ n ]
If n is 1, macros are echoed when they are invoked.  If n is 0 (the default), macros are not echoed.  If n is missing, the status of the echo flag is printed.  If the ec command is given within a macro body, it is in effect for that macro only. 

interact n
If n is 1, interactive commands (such as di, bt, and dr) when invoked during macro execution will read input from the user.  If n is 0 (the default), interactive commands inside macros will read input from the macro body.  The interact command affects only the currently-executing macro and has no effect outside a macro body. 

onbreak [ “name” ]
Set the on-break macro to the macro named by name.  If name is omitted, it disables the on-break macro feature.  The on-break macro, if one is specified, is executed on every entrance to the debugger resulting from any trap or breakpoint.  This feature is very handy for implementing conditional breakpoints. 

do “name” [ args ... ]
Repeatedly call the named macro with any args specified, until an exit command is executed.  This is the only explicit form of iteration the debugger provides.  The args are passed to the first — and, if setarg is not used, to every — iteration. 

exit Stop iterating a repeated macro call (see do).  Note that exit does not terminate the execution of the current macro; it merely prevents further iterations. 
 
 

Predefined Macros

buf addr Print selected fields of a struct buf at the given address. 

buf+ addr
Run buf addr and set up the debugger to display the next adjacent buffer. 

buf- addr
Run buf addr and set up the debugger to display the previous adjacent buffer. 

bufv addr
Run buf addr and set up the kernel debugger to display the buffer at addr->av_forw each time a carriage return is entered. 

dataunit
Prints information in the data pipeline.

dmt Prints information in the data unit. 

xintrq addr
Print all the inter-CPU interrupt queues.

xintrq+ addr
Run xintrq addr and set up the kernel debugger to print the next adjacent inter-CPU interrupt queue. 

inode addr
Print selected fields of a struct inode (in the same manner as sys/inode.h). 

inode+ addr
Run inode addr and set the debugger up to print the next adjacent inode address. 

msg addr
Print information about the message at addr. 

msgq addr
Print information about the message queue at addr. 

msgqs Print information about all active message queues and queued messages.  Also, print count of free messages. 

mutex addr
Print selected fields of a struct mutex. 

curlock Print the master processor’s curlock stack. 

percpu addr
Print selected fields of a struct percpu. 

percpup+ addr
Run percpu ∗addr and set the debugger up to display the next adjacent cpu address. 

cpuinfo cpuid
Print selected fields of a struct cpuinfo for the given CPU. 

proc addr
Print selected fields of a struct proc. 

proc+ addr
Run proc addr and set up the debugger to display the next adjacent processor address. 

ps Simulate /bin/ps -l. 

pss Similar to ps, but prints process size and rss. 

psr addr Prints the processor status register in the short form. 

psrl addr
Prints the processor status register in the long form.

ptdat addr
Print the pagetable data data structure. 

pid pid Find a process with the given pid (remember, the default debugger radix is hex, not decimal) and run proc on it. 

btproc addr
Set the KDB process context to addr and run the backtrace bt command. 

reboot Reboots the system.  If the system does not reboot, this macro prints "The system did not reset!"

sem addr
Print information about a single semaphore at addr.  (This is one semaphore of a set associated with a semaphore id.) 

semset addr
Print information about the set of semaphores (with the same semaphore id) at addr, and all semaphores associated with that semaphore id. 

semsets
Print information about all active semaphore ids in the system and their semaphores.

strstat Prints selected STREAMS statistics. 

strmsg addr
Print selected fields of a struct msgb. 

strqueue addr
Print selected fields of a struct queue. 

strqueue_band addr
Print selected fields of a struct qband. 

stream addr
Print selected fields of a struct stdata and substructures. 

streams
Print all streams except muxs. 

streams_muxs
Print all streams. 

queues Print all streams queues. 

queues_flag
Print all streams queues with none of the flags set. 

stream_find addr
Find and print a stream associated with the given queue. 

dumpnpi addr
Interprets and displays the appropriate contents of the a N_primitive union as a Network Provider Interface message.  addr should be the address of the message block. 

dumptpi addr
Interprets and displays the appropriate contents of the a T_primitive union as a Transport Provider Interface message.  addr should be the address of the message block. 

dumpque addr
Dumps out the entire queue structure in the order defined in the structure. 

dumpmsgb addr
Dumps out the entire msgb structure in the order defined in the structure. 

dumpdatab addr
Dumps out the datab structure and the data from db_base to the end of data as a hex and ascii dump. 

findmsgs
Prints out all the queues that have message blocks attached to them.

findsched
Prints out all the queues who’s q_link field is non-zero.  If the q_link is non-zero it may indicate that the queues is on the streams schedular list. 

tty addr Print selected fields of a struct tty. 

tty+ addr
Run tty addr and set the debugger up to run tty on the next adjacent address. 

user addr
Print selected fields of a struct user. 

vnode addr
Print selected fields of a struct vnode. 

vnode+ addr
Run vnode addr and set up the debugger to run vnode on the next adjacent address. 

memregion addr
Print the content of a memory region structure. If addr is omitted, memregion prints the content of the first memory region. 

memregion+ addr
Run memregion addr, and set up the debugger to run memregion on the next memory region. 

pipenode addr
Dumps the contents of the pipenode structure which resides at addr. 

pipebuf addr
Dumps the contents of the pipebuf structure which resides at addr. 

fifonode addr
Dumps the contents of the fifonode structure which resides at addr. 

pipestat
Shows the current status of the pipe buffer freelists.

uname Prints system information in a format like that of the uname -a command. 

prtconf Prints system configuration information in a format similar to, but not identical to the prtconf command. 

kmem_avail
Prints the current values of certain kernel memory parameters which are relevant to the kmem layer.  Algorithm is the same as that used by the DDI/DKI kmem_avail() function.

device Converts a device number into a Major/Minor pair. 

bug Forces KDB to drop into the system BUG.  Can return to KDB with the ’go’ command. 

findrg Searches the kernel stack and interrupt stack for likely register sets associated with a kernel FAULT.  The search algorithm does not guarantee that each hit is an actual register set. 

sleeptime
Shows how long each sleeping process has been asleep.  Useful in debugging crashdumps of hung systems.

callouts
Displays the callout table for each CPU.

showconsole
Displays the contents of the console buffer.

ghosttraces
Since the 88k does not use a set stackframe size, it is possible to find traces of old backtraces in the U.  This function finds all backtraces in the U and on the interrupt stack.  Useful for finding a system’s general location when the registers aren’t saved at crashtime.  Mainly for use with kcrash.

unixname
Prints the filename of the booted kernel.

alltraces
Prints a backtrace for every process on the system.

findfd addr
Finds all active file descriptors for the given proc address, prints the associated vnode address, and lists the symbolic name of the vnode op table.

The following debugger command names can be used to create macro names for both user area access and for physical memory access.  To be used for user area access, the names of these macros are created by adding a "u" to the end of the debugger command name.  (For example, ewu addr.)  To be used for physical memory access, the names of these macros are created by adding a "p" to the end of the debugger command name.  (For example, ewp addr.) 

ew addr Examine word. 

eh addr Examine half word. 

eb addr Examine byte. 

mw addr
Modify word.

mh addr Modify half word. 

mb addr Modify byte. 

ww addr Write word. 

wh addr Write half word. 

wb addr Write byte. 

map addr
Map address.

fill aai Fill memory. 

di a?i Disassemble. 

ei a?i Examine instructions. 

mi a?i Modify instructions. 

dw a?i Display word. 

dh a?i Display half word. 

db a?i Display byte. 

dy a?i Display symbolic. 

se a?i Search memory. 

The following macros are used for virtual memory access. 

anon a?i

anon+ addr

anoninfo a?i

anoninfo+ addr

anon_map a?i

anon_map+ addr
Display information about the anonymous memory structures.

page a?i

page addr
Display the page structure in a readable format. (pagen addr follows the p_next member, pagev addr follows the p_vpnext member, and pageh addr follows the p_hash member.) 

page+ a?i

page+ addr
Display the page structure and set the debugger up to display the next adjacent page structure address.

page_pfn page_frame_number
Display the page structure when given the page frame number.

page_map a?i

page_map addr
Print the page structure along with its pmapping structure. 

page_pt a?i

page_pt addr
Print a page structure and ptdat structure.  The addr must point to a page that is a page table. 

pmapping a?i

pmapping addr
Print the ptes that are in a mapping structure. 

pte a?i

pte+ addr
Display information about a page table entry given a virtual address.

physpte a?i

physpte+ phys addr
Display information about a page table entry given a physical address.

ste a?i

ste+ addr
Display information about segment table entries.

area a?i

area+ addr
Display the area pointer.

batc a?i

batc+ addr
Display information about BATC entries.

hat a?i Display the contents of the hat structure provided as an argument. 

ptdat a?i

ptdat+ addr
Display the contents of the ptdat structure. 

as a?i Display information about an address space structure. 

seg_ops a?i
Display information about a segment operations structure.

seg a?i

seg+ addr
Display information about a segment.

segdev_crargs a?i

segdev_crargs+ addr

segdev_data a?i

segdev_data+ addr
Display information about selected segdev data structures. 

segmap_crargs a?i

segmap_crargs+ addr

smap a?i

smap+ addr

segmap_data a?i

segmap_data+ addr
Display information about selected segmap data structures. 

segu_segdata a?i

segu_segdata+ addr

segu_data a?i

segu_data+ addr
Display information about selected segu data structures. 

segvn_crargs a?i

segvn_crargs+ addr

segvn_data a?i

segvn_data+ addr
Display information about selected segvn data structures. 

vpage a?i

vpage+ addr
Display information about pages associated with a VNODE.

Conditional Commands

IF expr

EL

FI If the expression evaluates to zero, all commands up to the matching EL or FI are skipped.  If the expression is non-zero, execution proceeds normally to the matching FI, unless a matching EL is found, in which case, commands between the EL and the FI are skipped.  During any of this “skipping,” the prompt changes from Kn> to −Kn> to indicate that the commands are being read but not executed. 

if expr

elseif expr

else

fi Same as IF-EL-FI but with the elseif construct which allows chaining of conditional statements. 

ifdef “name”
Like if, but the condition is “true” if a macro named name exists. 

ifsdef “name”
Like if, but the condition is “true” if a symbol named name exists. 

NOTES

The arguments displayed by the bt (backtrace) command for each function in the backtrace may not be correct.  The number of arguments displayed may be greater than the actual number of argument to the routine. 

The debugger does not prevent the user from setting data or instruction breakpoints or tracing routines the debugger itself requires for its normal operation.  If breakpoints or tracing occur in these support routines or regions of memory, the debugger will hang the system. 

FILES

/usr/lib/kdb/macrosDirectory containing macro files. 

  —  Multiprocessing

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026