[\fB\-w\fR] [ \fB\-k\fR ] [ \fB-I\fRdir ] [ objfil [ corfil ] ]
.ds TW \v'.25m'\s+2~\s-2\v'-.25m'
.ds IM \v'.1m'=\v'-.1m'\s-2\h'-.1m'>\h'.1m'\s+2
is a general purpose debugging program.
It may be used to examine files and to provide
a controlled environment for the execution of UNIX programs.
is normally an executable program file, preferably
containing a symbol table; if not then the symbolic features of
cannot be used although the file can still be examined.
is assumed to be a core image file produced after executing
are read from the standard input and responses are to the standard output.
flag is present then both
are created if necessary and opened for reading and writing
so that files can be modified using
The \fB\-k\fP option makes \fIadb\fP do UNIX kernel memory
mapping; it should be used when \fIcore\fP is a UNIX crash dump
The \fB\-I\fP option specifies a directory where files to be read
with $< or $<< (see below) will be sought; the default is
ignores QUIT; INTERRUPT causes return to the next
[\|\fIcommand\fR\|] [\|;\|]
is set to 0. For most commands
specifies how many times the command will be executed. The default
The interpretation of an address depends on the context it is used in.
If a subprocess is being debugged then addresses are interpreted
in the usual way in the address space of the subprocess.
If the operating system is being debugged either post-mortem or using
to interactive examine and/or modify memory the maps are set to map
the kernel virtual addresses which start at 0x80000000 (on the VAX).
incremented by the current increment.
decremented by the current increment.
A number. The prefixes 0o and 0O (\*(lqzero oh\*(rq) force interpretation
in octal radix; the prefixes 0t and 0T force interpretation in
decimal radix; the prefixes 0x and 0X force interpretation in
hexadecimal radix. Thus 0o20 = 0t16 = 0x10 = sixteen.
If no prefix appears, then the
is used; see the $d command. The default radix is initially hexadecimal.
The hexadecimal digits are 0123456789abcdefABCDEF with the obvious
values. Note that a hexadecimal number whose most significant
digit would otherwise be an alphabetic character must have a 0x
(or 0X) prefix (or a leading zero if the default radix is hexadecimal).
A 32 bit floating point number.
The ASCII value of up to 4 characters.
\e may be used to escape a \'.
which is either a variable name or a register name.
maintains a number of variables (see
named by single letters or digits.
is a register name then the value of the register is obtained from
The register names are those printed by the $r command.
is a sequence of upper or lower case letters, underscores or
digits, not starting with a digit. The backslash character
may be used to escape other characters. The value of the
is taken from the symbol table in
An initial \_ will be prepended to
In C, the `true name' of an external symbol begins with _.
It may be necessary to utter this name to distinguish it
from internal or hidden variables of a program.
The address of the variable
in the specified C routine. Both
is omitted the value is the address of the most recently activated C stack frame
(This form is currently broken on the VAX; local variables can be examined
The value of the expression
The contents of the location addressed by
The contents of the location addressed by
are left associative and are less binding than monadic operators.
rounded up to the next multiple of
Most commands consist of a verb followed by a modifier or list of modifiers.
The following verbs are available.
(The commands `?' and `/' may be followed by `\*(ST'; see
are printed according to the format
is incremented by the sum of the increments for each format letter (q.v.).
are printed according to the format
is incremented as for `?'.
itself is printed in the styles indicated by the format
format `?' is printed for the parts of the instruction that reference
consists of one or more characters that specify a style of printing.
Each format character may be preceded by a decimal integer
that is a repeat count for the format character.
While stepping through a format
is incremented by the amount given for each format letter.
If no format is given then the last format is used.
The format letters available are as follows.
Print 2 bytes in octal. All octal numbers output by
Print 2 bytes in hexadecimal.
Print 4 bytes in hexadecimal.
Print as an unsigned decimal number.
Print long unsigned decimal.
Print the 32 bit value as a floating point number.
Print double floating point.
Print the addressed byte in octal.
Print the addressed character.
Print the addressed character using
the standard escape convention where control characters
are printed as ^X and the delete character is printed as ^?.
Print the addressed characters until a zero character is reached.
Print a string using the ^\fIX\fR escape convention (see \fBC\fR above).
is the length of the string including its zero terminator.
Print 4 bytes in date format (see
Print as machine instructions.
is the number of bytes occupied by the instruction.
This style of printing causes variables 1 and 2 to be set
to the offset parts of the source and destination respectively.
Symbols are checked to ensure that they have an appropriate
/ local or global data symbol
? local or global text symbol
= local or global absolute symbol
Print the addressed value in symbolic form using
the same rules for symbol lookup as
When preceded by an integer tabs to the next appropriate tab stop.
moves to the next 8-space tab stop.
Print the enclosed string.
is decremented by the current increment. Nothing is printed.
is incremented by 1. Nothing is printed.
is decremented by 1. Nothing is printed.
Repeat the previous command with a
.RB [ ?/ ] l "\fI value mask\fR"
is used then the match is for 4 bytes at a time instead of 2.
If no match is found then
is set to the matched location.
is omitted then \-1 is used.
.RB [ ?/ ] w "\fI value ...\fR"
into the addressed location. If the command is
Odd addresses are not allowed when writing to the subprocess address space.
[\fB?/\fR]\fBm\fI b1 e1 f1\fR[\fB?/\fR]
are recorded. If less than three expressions are given then
the remaining map parameters are left unchanged.
If the `?' or `/' is followed by `\*(ST' then
the second segment (\fIb2\fR\|,\|\fIe2\fR\|,\|\fIf2\fR)
of the mapping is changed.
If the list is terminated by `?' or `/' then the file (\fIobjfil\fR or
respectively) is used for subsequent requests.
(So that, for example, `/m?' will cause `/' to refer to
is assigned to the variable or register named.
A shell (/bin/sh) is called to read the rest of the line following `!'.
Miscellaneous commands. The available
Read commands from the file
If this command is executed in a file, further commands
in the file are not seen.
is omitted, the current input stream is terminated. If a
is given, and is zero, the command will be ignored.
The value of the count will be placed in variable
before the first command in
except it can be used in a file of commands without
causing the file to be closed. Variable
is saved during the execution of this command, and restored when it completes.
There is a (small) finite limit to the number of
files that can be open at once.
Append output to the file
which is created if it does not exist. If
is omitted, output is returned to the terminal.
Print process id, the signal which caused stoppage or termination,
as well as the registers as \fB$r\fR. This is the default if
\fImodifier\fR is omitted.
Print the general registers and the instruction addressed by
Print all breakpoints and their associated counts and commands.
is given then it is taken as the address of the current frame
instead of the contents of the frame\-pointer register. If
is used then the names and (32 bit) values of all automatic
and static variables are printed for each active function. (broken
is given then only the first
and report the new value. Note that
is interpreted in the (old) current radix.
Thus \*(lq10$d\*(rq never changes the default radix.
To make decimal the default radix, use \*(lq0t10$d\*(rq.
The names and values of external variables are printed.
Set the page width for output to
Set the limit for symbol matches to
All integers input are regarded as octal.
Print all non zero variables in octal.
.RI ( "Kernel debugging" )
Change the current kernel memory mapping to map the designated
to the address given by the symbol
argument is the address of the user's user page table entries (on
Manage a subprocess. Available modifiers are:
The breakpoint is executed
times before causing a stop.
Each time the breakpoint is encountered the command
is executed. If this command is omitted or sets
to zero then the breakpoint causes a stop.
is given explicitly then the program is entered at this point; otherwise
the program is entered at its standard entry point.
specifies how many breakpoints are to be ignored before stopping.
Arguments to the subprocess may be supplied on the same line as the command.
An argument starting with < or > causes the standard
input or output to be established for the command.
The subprocess is continued with signal
is given then the subprocess is continued at this address.
If no signal is specified then the signal
that caused the subprocess to stop is sent.
Breakpoint skipping is the same as for
except that the subprocess is single stepped
times. If there is no current subprocess then
is run as a subprocess as for
In this case no signal can be sent; the remainder of the line
is treated as arguments to the subprocess.
The current subprocess, if any, is terminated.
provides a number of variables.
Named variables are set initially by
but are not used subsequently.
Numbered variables are reserved for communication as follows.
The last offset part of an instruction source.
The previous value of variable 1.
The count on the last $< or $<< command.
On entry the following are set from the system header in the
file then these values are set from
The base address of the data segment.
The `magic' number (0407, 0410 or 0413).
The address in a file associated with
a written address is determined by a mapping associated with that file.
Each mapping is represented by two triples
corresponding to a written
is calculated as follows.
.IR b1 \*(LE address < e1
.IR "file address" = address + f1\-b1,
.IR b2 \*(LE address < e2
.IR "file address" = address + f2\-b2,
is not legal. In some cases (e.g. for programs with separated I and D
space) the two segments for a file may overlap. If a
then only the second triple is used.
The initial setting of both mappings is suitable for normal
files. If either file is not of the kind expected then, for that file,
is set to the maximum file size and
is set to 0; in this way the whole
file can be examined with no address translation.
`Adb' when there is no current command or format.
Comments about inaccessible files, syntax errors,
abnormal termination of commands, etc.
Exit status is 0, unless last command failed or returned nonzero status.
Since no shell is invoked to interpret the arguments of the
command, the customary wild-card and variable expansions cannot occur.