.\" Copyright (c) 1980, 1990 The Regents of the University of California.
.\" %sccs.include.redist.man%
.\" @(#)adb.1 5.7 (Berkeley) %G%
.Op Ar objfil Op Ar corfil
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
mapping; it should be used when
option specifies a directory where files to be read
(see below) will be sought; the default is
causes return to the next
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 interactively examine and/or modify memory, the maps are set to map
the kernel virtual addresses which start at
(on the VAX); see ADDRESSES below.
incremented by the current increment.
decremented by the current increment.
in octal radix; the prefixes
decimal radix; the prefixes
If no prefix appears, then the
command. The default radix is initially hexadecimal.
The hexadecimal digits are
.Li 0123456789abcdefABCDEF
values. Note that a hexadecimal number whose most significant
digit would otherwise be an alphabetic character must have a
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.
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
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
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 currently active frame is used.
(This form is currently broken; local variables can be examined
is omitted the value is the address
of the most recently activated C stack frame
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.
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
itself is printed in the styles indicated by the format
format zero values are assumed
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 characters available are as follows.
to quote the three numeric formats.
Print 1 byte in the current radix
(which may be either signed or unsigned; see the
Print 2 bytes in the current radix.
Print 4 bytes in the current radix.
Print 2 bytes in the signed variant of the current radix.
Print 4 bytes in the signed variant of the current radix.
Print 2 bytes in unsigned octal. All octal numbers output by
Print 4 bytes in unsigned octal.
Print 2 bytes in signed octal.
Print 4 bytes in signed octal.
Print 2 bytes in unsigned decimal.
Print 4 bytes in long unsigned decimal.
Print 2 bytes in signed decimal.
Print 4 bytes in long signed decimal.
Print 2 bytes in unsigned hexadecimal.
Print 4 bytes in unsigned hexadecimal.
Print 2 bytes in signed hexadecimal.
Print 4 bytes in signed hexadecimal.
Print 4 bytes as a floating point number.
Print 8 bytes as a double floating point number.
Print 1 byte in unsigned octal.
Print 1 byte as a character.
Print 1 byte as a 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 ^
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 the numeric variables 1, 2, ... to be set
according to the offset parts of the arguments, if any, of the instruction
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
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 all bits are compared.
into the addressed location. If the command is
when writing to the subprocess address space.
are recorded. If less than three expressions are given then
the remaining map parameters are left unchanged.
of the mapping is changed.
If the list is terminated by
respectively) is used for subsequent requests.
is assigned to the variable or register named.
is called to read the rest of the line following
Miscellaneous commands. The available
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
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
(this is partially broken; the names are not now available). If
is given then only the first
and report the new value. If no
is given, the default radix is not changed.
The new radix must be between -16 (decimal) and 16 (decimal)
and must not be 0, 1, or -1.
A negative radix implies that numbers printed in that radix
will be treated as signed; otherwise they are treated as unsigned.
is interpreted in the (old) current radix.
Thus \*(lq10$d\*(rq simply changes the default radix to unsigned.
To make signed decimal the default radix, use \*(lq-0t10$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
Print all non zero variables in octal.
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.
Manage a subprocess. Available modifiers are:
The breakpoint is executed
times before causing a stop,
after which it stops unconditionally.
Each time the breakpoint is encountered the command
is executed. If this command is omitted or sets
to zero, the breakpoint causes a stop immediately,
regardless of any remaining count.
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.
This continues up through at most 6 on the VAX.
For a three-operand instruction, variable 2 is the second source offset
and variable 3 the destination offset part.
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.
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.
was first released with Version 7 AT&T UNIX. The version
is descended from the orignial.
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.