MTS 8: LISP and SLIP in MTS
June 1976
+ ***16 UNDEFINED ATOM
+ Q
+
* 1 : CAR BROKEN
USE XX
changes Q to XX in the form (CAR Q), which caused the
error.
# This aborts the break. This is a useful way to unwind
to a higher-level break. All other errors, including
those encountered while executing the GO, OK, EVAL and
RETURN commands, maintain the break.
## This returns control directly to the top level of
LISP.
ARGS This prints the names and the current values of the
arguments of the function at BREAKPOINTER. In most
cases, these are the arguments of the broken function.
FORM This is EVALed if not a break command.
Context Commands ________________
All information pertaining to the evaluation of forms in LISP is kept
on the push-down stack. Whenever a form is evaluated, the form is
placed on the push-down stack. Whenever a variable is bound, the old
binding is saved on the push-down stack. The context (the bindings of
free variables) of a function is determined by its position in the
stack. When a break occurs, it is often useful to explore the contexts
of other functions on the stack. BREAKFUNCTION allows this by means of
BREAKPOINTER, which is a context pointer into the push-down stack.
BREAKFUNCTION commands move the context pointer and evaluate atoms or
expressions relative to their positions in the stack. For the purpose
of this document, when moving through the stack, "backward" is consid-
ered to be toward the top level or, equivalently, towards the older
function calls on the stack.
F arg1 arg2 ... argN
This command resets the variable BREAKPOINTER, which
establishes a context for the commands USE, ARGS, AT,
FROM and the backtrace commands described below.
BREAKPOINTER is the position of a function call on the
push-down list. It is initialized to the function
just before the call to BREAKFUNCTION.
F takes the rest of the input line as its list of
arguments. Each argument may be either a function
104 LISP Debugging Facilities

MTS 8: LISP and SLIP in MTS
June 1976
name, in which case the stack is searched for the most
recent occurrence of the function preceding BREAK-
POINTER, or a number [±]n. If negative, the number
"n" specified causes BREAKPOINTER to move back (i.e.,
towards the top level) the appropriate number of
calls. If positive, the number "n" specified causes
BREAKPOINTER to move forward.
For example, if the push-down stack consists of:
BREAKFUNCTION (13)
FOO (12)
SETQ (11)
COND (10)
PROG (9)
FIE (8)
COND (7)
FIE (6)
COND (5)
FIE (4)
COND (3)
PROG (2)
FUM (1)
then
F FIE COND sets BREAKPOINTER to (7)
F COND sets BREAKPOINTER to (5)
F -2 moves BREAKPOINTER to (3)
TOP resets BREAKPOINTER to (12)
F can be used on BREAKCMDS. In that case, the next
element of the list is treated as the list of
arguments to F, e.g., (F (FOO FIE FOO)).
TOP TOP repositions BREAKPOINTER to a stack position just
before BREAKFUNCTION.
EDIT arg1 arg2 ... argn
EDIT uses its arguments to reset BREAKPOINTER in the
same manner as the F command. The form at BREAKPOINT-
ER is then given to EDIT. This command can often save
the user the trouble of calling EDIT and finding the
expression that he needs to edit.
AT arg1 arg2 ... argn
This command is used to display the values of varia-
bles at position BREAKPOINTER. If the user types:
AT X (CAR Y)
LISP Debugging Facilities 105
Previous Page Next Page