NAME
|
acid, truss, trump – debugger |
SYNOPSIS
|
acid [ –kqw ] [ –l library ] [ –m machine ] [ pid ] [ textfile ]
|
DESCRIPTION
|
Acid is a programmable symbolic debugger. It can inspect one or
more processes that share an address space. A program to be debugged
may be specified by the process id of a running or defunct process,
or by the name of the program's text file (8.out by default).
At the prompt, acid will store function definitions
or print the value of expressions. Options are –w Allow the textfile to be modified. –q Print variable renamings at startup. –l library Load from library at startup; see below. –m machine Assume instructions are for the given CPU type (one of alpha, 386, etc., as listed in 8c(1), or sunsparc or mipsco for the manufacturer–defined instruction notation for those processors) instead of using the magic number to select the CPU type. –k Debug the kernel state for the process, rather than the user state. –r Debug a remote kernel via rdbfs(4). Process 1 is assumed. Language
stk() Print a stack trace for current process. lstk() Print a stack trace with values of local variables. gpr() Print general registers. Registers can also be accessed by name, for example *R0. spr() Print special registers such as program counter and stack pointer. fpr() Print floating–point registers. regs() Same as spr();gpr(). fmt(expr,format)
Bsrc(address) Get the source line for the program address into a window of a running sam(1) and select it. line(address) Print source line nearest to the program address. source() List current source directories. addsrcdir(string)
pcfile(address)Convert a machine address to a source file name. pcline(address)Convert a machine address to a source line number. bptab() List breakpoints set in the current process. bpset(address) Set a breakpoint in the current process at the given address. bpdel(address) Delete a breakpoint from the current process. cont() Continue execution of current process and wait for it to stop. step() Execute a single machine instruction in the current process. func() Step repeatedly until after a function return. stopped(pid) This replaceable function is called automatically when the given process stops. It normally prints the program counter and returns to the prompt. asm(address) Disassemble 30 machine instructions beginning at the given address. mem(address,string)
newproc(arguments)
win() Like new(), but run the process in a separate window. start(pid) Start a stopped process. kill(pid) Kill the given process. setproc(pid) Make the given process current. rc(string) Escape to the shell, rc(1), to execute the command string. Libraries |
EXAMPLES
Start to debug /bin/ls; set some breakpoints; run up to the first
one:
|
FILES
|
/proc/*/text /proc/*/mem /proc/*/ctl /proc/*/note /sys/lib/acid/$objtype /sys/lib/acid/port /sys/lib/acid/kernel /sys/lib/acid/trump /sys/lib/acid/truss $home/lib/acid |
SOURCE
|
/sys/src/cmd/acid |
SEE ALSO
|
8a(1), 8c(1), 8l(1), mk(1), db(1) Phil Winterbottom, ``Acid Manual''. |
DIAGNOSTICS
|
At termination, kill commands are proposed for processes that
are still active. |
BUGS
|
There is no way to redirect the standard input and standard output
of a new process. Source line selection near the beginning of a file may pick an adjacent file. With the extant stepping commands, one cannot step through instructions outside the text segment and it is hard to debug across process forks. |