INTERPRETER PSAM/DAPDB INTERPRETER
NAME
interpreter - the psam and dapdb command-line interpreter
DESCRIPTION
The psam and dapdb debuggers have a common command syntax.
Commands can be executed in either debugger by typing the
command directly to the prompt or by executing commands
stored in a macro file.
The command syntax mimics that of the UNIX C-Shell. Text
output can be redirected to a file using the C-Shell > and
>> conventions; sequences of commands can be typed on the
same command line if separated by the ';' character; com-
mands can be repeated and substituted with the '!' conven-
tion. In addition certain commands accept regular expres-
sions containing '*', '?' etc. as parameters. Screen output
is piped to the text filter more.
More detailed descriptions of command concatenation, output
redirection and history substitution are given below.
Descriptions of the regular expressions accepted by commands
appear in the appropriate help information and a description
of the more filter can be obtained by consulting the UNIX
manual pages or by typing 'h' at the more prompt.
The command interpreter allows command abbreviation to the
minimum unambiguous form. Thus, for example, procedure can
be shortened to pro but no further as it would clash with
print.
Command Concatenation
Several commands can be typed on a single line if separated
by the ; character. The commands are executed one after
another. The commands continue, next, step, stepi and quit
terminate command sequences. That is, commands which appear
later in the sequence are not executed. For example:
stop at 10 ; continue
causes both commands to be executed, but:
continue ; stop at 10
causes only the command continue to be executed.
Output Redirection
The constructs:
<command> > <filename>
AMT Release 4.1S Last change: 11th May 1989 1
INTERPRETER PSAM/DAPDB INTERPRETER
and
<command> >> <filename>
redirect the text output of the given command to the speci-
fied file. In the first case if the file already exists it
is overwritten. In the second case the text is appended to
any contents of the file. In both cases the file is created
if none exists.
History Substitution
A numbered list of all the commands executed in a debugging
session is displayed by the history command. It is possible
to repeat commands or to substitute strings from previous
commands in new commands with C-Shell-like history substitu-
tion characters. Not all of the substitution characters
allowed by the C-Shell are supported. Those which are sup-
ported are described below:
!! repeat the previous command.
^<str1>^<str2>^ substitute the first occurrence of
<str1> for <str2> in the previous com-
mand.
!<str> repeat the most recent command which
started with <str>.
!<n> repeat command <n> in the history
list.
!-<n> repeat the <n>th previous command.
!$ repeat the last argument from the pre-
vious command.
!* repeat all arguments from the previous
command.
!^ repeat the first argument from the
previous command.
The following modifiers can follow the above commands:
:p print but do not execute the command.
:s/<str1>/<str2>/
substitute the first occurrence of
<str1> for <str2> in the command.
AMT Release 4.1S Last change: 11th May 1989 2
INTERPRETER PSAM/DAPDB INTERPRETER
Quotes
Characters enclosed by " characters are treated as a single
object and are not modified by the command line interpreter.
This is particularly important when using the stop and alias
commands where it may be necessary to specify a command as a
parameter. Consider the following two commands:
alias topvars top ; print *
alias topvars "top ; print *"
The first is a sequence of two commands the first of which
creates the alias topvars for the command top and the second
of which executes the command print *. The second is a sin-
gle command which creates the alias topvars for the sequence
of commands top ; print *.
Comments
Command lines which begin with the '#' character are
ignored. Thus comments can be embedded in macro files.
AMT Release 4.1S Last change: 11th May 1989 3