|
|
Output from kcrash functions may be piped to another program in the following way:
function [argument ...] ! shell_command
Example:
The kcrash command prompts with S>. This prompt indicates that kcrash 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, kcrash supports flow control (CTRL-S, CTRL-Q) and keyboard interrupt (CTRL-C).
During any of the display, modify, examine, or write commands, you can enter one of the following:
If an attempt is made to access an invalid virtual address, the command and all levels of invoked macros will be aborted and kcrash will prompt for the next command.
For example, the argument description for the se command is aai?i and for pf it is s*. If arg-desc is not given, the macro will be defined as requiring no arguments. Any kcrash 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 (\).
The tables below describe the kcrash alternatives to primary crash commands. To use kcrash effectively, you must understand the results of a given command in crash. You can then select an alternative to use with kcrash. The table below lists the effects of kcrash commands used as alternatives to crash commands.
Command |
Effect in crash |
Effect in kcrash |
!cmd | Works | ! [cmd] or !! [cmd] |
? | Works | ? [cmd] or ?? [cmd] |
as | Works | Load proc.k and dscr.k, address from as field in proc can be given to dscr macro |
async | Fails
"aio_list not found in symbol table" |
|
b (buffer) | Fails
"s not found in symbol table" |
Load buf.k |
base | Works | pr |
buf (bufhdr) | Fails "header, no content" | Load buf.k |
c (callout) | Fails "header, no content" | Load stat.k, cm callout |
class | Works | Load info.k, cm class |
dbfree | Not supported | dl *mdbfreelist |
dblock | Not supported | Not applicable |
defproc | Works | Load proc.k, cm setproc |
dis | Works | di [address] |
dispq | Fails | Load proc.k, cm dispq |
ds | Works | ds address |
evactive |
Fails "ev_actqp not found in symbol table" |
None |
evmm | Fails
"ev_mminfo not found in symbol table" |
None |
f (file) | Works | dl file or *file |
findaddr | Works | Requires manual calculation of table size and offset |
findslot | Fails
"no match for rt_proc in size table" |
None |
fs (vfssw) | Works | Load stat.k, cm vfssw |
gdp | Fails "gdp table not found" | None |
gdt | Works | Load dscr.k, cm gdt |
help | Works | ? [cmd] or ?? [cmd] |
hrt | Fails "header, no content" | dl hrtimes use structure in /usr/include/sys/hrtsys.h |
i (inode) | Fails "header, no content" | Load inode.k, cm inode address |
idt | Works | Load dscr.k, cm idt |
kfp | Works | dr save_panic_regs, use value in bp |
kmastat | Works | Load page.k, cm kmastat |
l (lck) | Works | |
ldt | Works | Use dR command |
linkblk | Works | Load stream.k, cm linkblk |
map | Works | None |
mbfree | Not supported | Not applicable |
mblock | Not supported | Not applicable |
mode | Works | pg |
mount (m, vfs) | Works | Load stat.k, cm vfsw |
nm | Works | nm "regular expression" |
od | Works | dl address |
p (proc) | Works | Load proc.k cm ps |
page | Works | Load page.k cm page address |
panic | Works | dl *panicstr |
pcb | Works | Load tss.k, cm tss address |
plock | Works | None |
prnode | Fails "header, no content" | crash uses this to look at /proc; not needed in kcrash |
ptbl | Fails "core dump" | Load page.k ptbl |
pty | Works | Load sertty.k, cm pty |
q (quit) | Works | q, qq, or quit |
qrun | Works | Load stream.k, cm queuerun |
queue | Works | Load stream.k, cm queues |
rcvd | Fails "receive descriptor table not found" | |
rd (od) | Works | dl |
rduser | Fails "rcvd user table not found" | Not applicable |
redirect | Works | Use of cf |
resource | RFS | None |
rtdptbl | Works | Load proc.k, cm rtdptbl |
rtproc | Fails "header, no content" | |
runq | Fails "runq not yet implemented" | Load proc.k, cm runq |
s (stack) | Works | bt |
searc | Works | se |
size | Works | None |
sndd | Fails
"send descriptor table not found" |
Not applicable |
snode | Works | Load inode.k, cm snode |
srmount | RFS | Not applicable |
stat | Works | Load stat.k, cm stat |
stream | Works | Load stream.k, cm streams |
strstat | Works | Load stream.k, cm strstat |
t (trace) | Works | Load trace.k, cm trace address |
test | Works | Not applicable |
ts | Works | ds address |
tsdptbl | Works | Load proc.k, cm tsdptbl |
tsproc | Works | Load proc.k, cm tsproc |
tty | Fails "tty struct for asy not found in symbol table" | dl various tty structures |
u (user) | Works | Load user.k, cm user [address] |
ui (uinode) | Works | Load uinode.k, cm uinode address |
v (var) | Works | Load stat.k, cm var |
vnode | Works | Load vnode.k, cm vnode address |
vtop | Works | None |
To make these macros available you can execute the command
< /usr/lib/crash/macros/loadmacs