adb(1) CLIX adb(1)
NAME
adb - Runs the absolute debugger
SYNOPSIS
adb [-w] [objfil [corfil]
DESCRIPTION
adb is a general purpose debugging program. It may be used to examine
files and to provide a controlled environment for the execution of CLIX
system programs.
The objfil argument is normally an executable program file, preferably
containing a symbol table. If it does not contain a symbol table, the
symbolic features of adb cannot be used, although the file can still be
examined. The default for objfil is a.out. The corfil argument is
assumed to be a core image file produced after executing objfil. The
default for corfil is core.
Requests to adb are read from stdin and responses are to stdout. If the
-w flag is present, objfil and corfil are created, if necessary, and
opened for reading and writing so that files can be modified using adb.
The command adb ignores QUIT. INTERRUPT causes return to the next adb
command.
In general, requests to adb have the form
[address][,count][command][;]
If address is present, dot is set to address. Initially, dot is set to 0.
For most commands, count specifies how many times the command will be
executed. The default count is 1. Address and count are expressions.
The interpretation of an address depends on the context in which it is
used. If a subprocess is being debugged, addresses are interpreted in the
usual way in the address space of the subprocess. For further details of
address mapping see Addresses.
Expressions
. The value of dot.
+ The value of dot incremented by the current increment.
^ The value of dot decremented by the current increment.
" The last address typed.
integer
2/94 - Intergraph Corporation 1
adb(1) CLIX adb(1)
A hexadecimal, decimal, or octal number, depending on whether the
number begins with 0x, 0t, or 0o, respectively. Otherwise, a
hexadecimal number.
integer.fraction
A 32-bit, floating-point number.
'cccc' The ASCII value of up to four characters. A \ may be used to
escape a '.
<name The value of name is a variable name or a register name. adb
maintains a number of variables (see Variables) named by single
letters or digits. If name is a register name, the register value
is obtained from the subprocess or the system header in corfil.
The register names are r0 to r15, f0 to f7, f0x to f7x, psw, ssw,
and pc for the general, floating-point, and processor registers.
Register names fp and sp are synonyms for r14 and r15,
respectively. Register names f0 to f7 are the low-order 32 bits of
the floating-point registers and f0x to f7x are the high-order 32
bits.
symbol A symbol is a sequence of uppercase or lowercase letters,
underscores, or digits not starting with a digit. \ may be used to
escape other characters. The value of the symbol is taken from the
symbol table in objfil. An initial _ or ~ will be prefixed to
symbol if needed.
_symbol
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.
(exp) The value of the expression exp.
Monadic operators:
*exp The contents of the location addressed by exp in corfil.
@exp The contents of the location addressed by exp in objfil.
-exp Integer negation.
~exp Bitwise complement.
Dyadic operators are left associative and are less binding than monadic
operators.
e1+e2 Integer addition.
e1-e2 Integer subtraction.
2 Intergraph Corporation - 2/94
adb(1) CLIX adb(1)
e1*e2 Integer multiplication.
e1%e2 Integer division.
e1&e2 Bitwise conjunction.
e1|e2 Bitwise disjunction.
e1#e2 E1 rounded up to the next multiple of e2.
Commands
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 * (see Addresses).)
?f Locations starting at address in objfil are displayed according to the
format f. The value of dot is incremented by the sum of the
increments for each format letter.
/f Locations starting at address in corfil are displayed according to the
format f, and dot is incremented as it is for ?.
=f The value of address is displayed in the styles indicated by the
format f. (For i format, ? is displayed for the parts of the
instruction that reference subsequent words.)
A format consists of one or more characters that specify a displaying
style. Each format character may be preceded by a decimal integer that is
a repeat count for the format character. While stepping through a format,
dot is incremented by the amount given for each format letter. If no
format is given, the last format is used. The format letters available
are as follows:
o 2 Display 2 bytes in octal. All octal numbers output by adb are
preceded with 0.
O 4 Display 4 bytes in octal.
q 2 Display in signed octal.
Q 4 Display in long signed octal.
d 2 Display in decimal.
D 4 Display in long decimal.
x 2 Display 2 bytes in hexadecimal.
X 4 Display bytes in hexadecimal.
2/94 - Intergraph Corporation 3
adb(1) CLIX adb(1)
u 2 Display as an unsigned decimal number.
U 4 Display long unsigned decimal.
f 4 Display the 32-bit value as a floating-point number.
F 8 Display double floating-point.
b 1 Display the addressed byte in octal.
c 1 Display the addressed character.
C 1 Display the addressed character using the following escape
convention. Character values 000 to 040 are displayed as @
followed by the corresponding character in the range 0100 to 0140.
The character @ is displayed as @@.
sn Display the addressed characters until a zero character is reached.
The value n is the length of the string including its zero
terminator.
Sn Display a string using the @ escape convention. The value n is the
length of the string including its zero terminator.
Y 4 Display 4 bytes in date format.
i 2 Display as CLIPPERTM instructions.
a 0 Display the value of dot in symbolic form. Symbols are checked to
ensure that they have an appropriate type as indicated below.
/ Local or global data symbol.
? Local or global text symbol.
I= Local or global absolute symbol.
p 2 Display the addressed value in symbolic form using the same rules
for symbol lookup as a.
t 0 When preceded by an integer, tabs to the next appropriate tab stop.
For example, 8t moves to the next 8-space tab stop.
r 0 Display a space.
n 0 Display a newline.
"string" 0
Display the enclosed string.
^ The value of dot is decremented by the current increment. Nothing
4 Intergraph Corporation - 2/94
adb(1) CLIX adb(1)
is displayed.
+ The value of dot is incremented by 1. Nothing is displayed.
- The value of dot is decremented by 1. Nothing is displayed.
<newline>
Repeat the previous command with a count of 1.
[?/]valuemask
Words starting at dot are masked with mask and compared to value
until a match is found. The mask argument is optional. The mask
used is 0xff for b and o, 0xffff for w, -1 for l, mask if supplied,
or -1 by default. The incr argument is optional. The value of dot
is incremented by 1 for b, 2 for w, 4 for l, the size of the
instruction for o, incr if specified, or 1 by default. If a match
is found, dot is set to the matched location. Otherwise, dot is
unchanged.
[?/]wvalue ...
Write the 2-byte value into the addressed location. If the command
is W, write 4 bytes. Odd addresses are allowed under the CLIX
system when writing to the subprocess address space.
[?/] m b1 e1 fl[?/]
New values for (b1, e1, f1) are recorded. If less than three
expressions are given, the remaining map parameters are unchanged.
If the ? or / is followed by *, the second segment (b2, e2, f2) of
the mapping is changed. If the list is terminated by ? or /, the
file (objfil or corfil, respectively) is used for subsequent
requests. (So that, for example, /m? will cause / to refer to
objfil.)
>name The value of dot is assigned to the variable or register named.
! A shell is called to read the remainder of the line following !.
$modifier
Miscellaneous commands. The available modifiers are as follows:
<f Read commands from the file f and return.
>f Send output to the file f, which is created if it does not exist.
r Display the general registers and the instruction addressed by the
PC. The value of dot is set to the PC. All registers are
displayed as if they were integer registers, including the
floating-point registers.
b Display all breakpoints and their associated counts and commands.
2/94 - Intergraph Corporation 5
adb(1) CLIX adb(1)
c C stack backtrace. Routine names are displayed for routines that
set up a frame pointer (see cc). If count is given, only the first
count frames are displayed.
e The names and values of external variables are displayed.
w Set the page width for output to address (default 80).
s Set the limit for symbol matches to address (default 255).
o All integers input are regarded as octal.
d Reset integer input as described in Expressions.
q Exit from adb.
v Display all nonzero variables in octal.
m Display the address map.
:modifier
Manage a subprocess. Some process management commands do not work until
the process is created. The :r, and :s commands create a process first,
if necessary. Available modifiers are as follows:
bc Set breakpoint at address. The breakpoint is executed count-1 times
before causing a stop. Each time the breakpoint is encountered, the
command c is executed. If this command sets dot to zero, the
breakpoint causes a stop. the subprocess is entered.
d Delete breakpoint at address.
r Run objfil as a subprocess. If address is given explicitly, the
program is entered at this point. Otherwise, the program is entered
at its standard entry point. The value count specifies how many
breakpoints are ignored before shipping. Arguments to the subprocess
may be supplied on the line the command is on. An argument starting
with < or > causes stdin or stdout to be established for the command.
All signals are turned on when the subprocess is entered.
cs The subprocess is continued with signal s (see signal). If address
is given, the subprocess continues at this address. If no signal is
specified, the signal that caused the subprocess to stop is sent.
Breakpoint skipping is the same as for r.
ss Same as for c except that the subprocess is single stepped count
times. If there is no current subprocess, objfil is run as a
subprocess as it is for r. In this case, no signal can be sent; the
remainder of the line is treated as arguments to the subprocess.
6 Intergraph Corporation - 2/94
adb(1) CLIX adb(1)
k The current subprocess, if any, is terminated.
Variables
Named variables are set initially by adb but are not used subsequently.
Numbered variables are reserved for communication as follows.
0 The last value displayed.
On entry, the following are set from the system header in the corfil. If
corfil does not appear to be a core file, these values are set from
objfil.
b The base address of the data segment.
d The data segment size.
e The entry point.
m The ``magic'' number (0405, 0407, 0410 or 0411).
s The stack segment size.
t The text segment size.
Addresses
The address in a file associated with a written address is determined by a
mapping associated with the file. Each mapping is represented by two
triples, (b1, e1, f1) and (b2, e2, f2), and the file address corresponding
to a written address is calculated as follows:
b1<address<e1 -> fileaddress=address+f1-b1
Otherwise, it is calculated as follows:
b2<address<e2 -> fileaddress=address+f2-b2
If one of these methods does not succeed, the requested address is not
legal. In some cases (that is, for programs with separated I and D
space), the two segments for a file may overlap. If a ? or / is followed
by an *, only the second triple is used.
The initial setting of both mappings is suitable for normal a.out and core
files. If neither file is the kind expected, for that file b1 is set to
0, e1 is set to the maximum file size, and f1 is set to 0. In this way,
the whole file can be examined with no address translation.
For adb to be used on large files, all appropriate values are kept as
signed, 32-bit integers.
2/94 - Intergraph Corporation 7
adb(1) CLIX adb(1)
FILES
/dev/mem
/dev/swap
a.out
core
NOTES
A breakpoint set at the entry point is not effective on initial entry to
the program.
Local variables whose names are the same as an external variable may
DIAGNOSTICS
The string adb is displayed when there is no current command or format.
Otherwise, comments about inaccessible files, syntax errors, abnormal
command termination, and so on, are displayed. Exit status is 0 unless
the last command failed or returned a nonzero status. cause problems in
accessing the external.
RELATED INFORMATION
Commands: acc(1), cc(1)
Functions: ptrace(2)
Files: a.out(4), core(4).
8 Intergraph Corporation - 2/94