MTS 8: LISP and SLIP in MTS
June 1976
the value of X and the value of (CAR Y) are printed.
The difference between using AT and entering X and
(CAR Y) directly into BREAKFUNCTION is that AT evalu-
ates its input as of BREAKPOINTER. This provides a
way of examining variables or forms at a particular
point on the stack. For example,
F FOO -1 FOO
AT X
allows the user to examine the value of X in an
earlier call to FOO.
AT can also be used on the BREAKCMDS list. The next
element of the BREAKCMDS list is then treated as the
list of arguments. For example, if BREAKCMDS is (EVAL
AT (X (CAR Y) GO), BREAKEXPR will be evaluated, values
of X and (CAR Y) will be printed, and the function
will be exited after its value has been printed.
FROM [form] FROM exits the break by undoing the push-down stack
back to BREAKPOINTER. If "form" is not specified,
reevaluation continues with the form on the push-down
stack at BREAKPOINTER. If "form" is specified, the
function call on the push-down stack at BREAKPOINTER
is replaced by "form", and evaluation continues with
"form" which is evaluated in the context of BREAK-
POINTER. There is no way of recovering the break
because the push-down stack has been undone. FROM
allows the user to return a particular value for any
function call on the stack. To return 1 as the value
of the previous call to FOO:
:F FOO
:FROM 1
Backtrace Commands __________________
The backtrace commands print information about function calls on the
push-down list. The information is printed in reverse order to that in
which calls were made. All backtraces start at BREAKPOINTER.
BKF BKF gives a backtrace of the CARs of forms that are
still pending.
BKE BKE gives a backtrace of the expressions which called
functions still pending (i.e., it prints the function
calls themselves instead of only the names, as in
BKF).
106 LISP Debugging Facilities

MTS 8: LISP and SLIP in MTS
June 1976
BK BK gives a full backtrace of all expressions still
pending. It evaluates the form (DUMP 0). Output is
in the form:
function name
list of arguments
function name
list of arguments
(etc.)
BKF and BKE may be followed by an integer. If the integer is
included, it specifies how many blocks are to be printed. The limiting
point of a block is a function call. This form is useful when working
on an IBM 3270-type terminal.
By specifying an integer with BKF or BKE and issuing an F command,
the user can display any contiguous part of the backtrace.
BREAK PACKAGE _____________
How to Set a Break __________________
In order to access any of the following functions, the user must be
sure the DEBUG package has been loaded. This may be accomplished by
calling the DEBUG function (see the subsection "Error Package").
The following functions are useful for setting and unsetting BREAKs
and TRACEFs.
Both BREAKF and TRACEF use a function BREAKO to do the actual
modification of function definitions.
BREAKF BREAKF is an FLAMBDA. For each atomic argument, ______
BREAKF breaks the function named each time it is
called. For each argument that is a list of the form
(FN1 IN FN2), it breaks only those occurrences of FN1
which appear in FN2. This feature is very useful for
breaking a function that is called from many loca-
tions, but where one is only interested in the call
from a specific function, e.g., (RPLACA IN FOO),
(PRINT IN FIE), etc. For each argument that is
neither atomic nor a list in the above form, BREAKF
assumes that the CAR is a function to be broken; the
CADR is the break condition. When the function is
called, the break condition is evaluated. If it
returns a non-NIL value, the break occurs. Otherwise,
computation continues without break and the CADDR is a
list of command lines to be performed before an
interactive break is made (see BREAKWHEN and BREAKCMDS
of BREAKFUNCTION) or NIL. For example,
LISP Debugging Facilities 107
Previous Page Next Page