MTS 8: LISP and SLIP in MTS
June 1976
(BREAKF FOO1 (FOO2 (GREATERP N 5) (ARGS)))
breaks all calls to FOO1 and all calls to FOO2 when N
is greater than 5 after first printing the arguments
of FOO2.
(BREAKF ((FOO4 IN FOO5) (MINUSP X) NIL))
breaks all calls to FOO4 made from FOO5 when X is
negative.
Examples:
(BREAKF FOO)
(BREAKF ((GET IN FOO) T (GO)))
TRACEF TRACEF is an FLAMBDA. For each atomic argument, it
TRACEFs the function named each time it is called.
For each list in the form (FN1 IN FN2), it TRACEFs
only those calls to FN1 that occur within FN2.
For example, (TRACEF FOO1 (SETQ IN FOO3) causes both
FOO1 and SETQ in FOO3 to be traced.
Note: The user can always call BREAKO himself to
obtain combinations of options of BREAKFUNCTION not
directly available with BREAKF and TRACEF (see section
on BREAKO below). These functions merely provide
convenient ways of calling BREAKO, and will serve for
most uses.
UNBREAK UNBREAK is an FLAMBDA. It takes a list of functions
modified by BREAKF or TRACEF and restores them to
their original state. Its value is NIL. (UNBREAK T)
will unbreak the function most recently broken.
(UNBREAK) will unbreak all of the functions currently
broken.
If one of the functions, say FN, is not broken,
UNBREAK prints "FN NOT BROKEN" for that function and
no changes are made to FN.
UNTRACEF UNTRACEF is an FLAMBDA. It is the similar to UNBREAK.
BREAK0 [fn when coms]
BREAK0 is an EXPR. It sets up a break on the function
"fn" by redefining "fn" as a call to BREAKFUNCTION
with BREAKEXPR a form equivalent to the definition of
"fn", and "when", "fn", and "coms" as BREAKWHEN,
BREAKFN, and BREAKCMDS, respectively (see BREAKFUNC-
108 LISP Debugging Facilities

MTS 8: LISP and SLIP in MTS
June 1976 Page Revised February 1979
TION). BREAK0 also adds "fn" to the front of the list
BROKENFNS. Its value is "fn".
If "fn" is nonatomic and of the form (fn1 IN fn2),
BREAK0 first calls a function which changes the name
of "fn1" wherever it appears inside of "fn2" to that
of a new function, fn1-IN-fn2, which is initially
defined as "fn1". Then BREAK0 proceeds to break on
fn1-IN-fn2 exactly as described above. This procedure
is useful for breaking on a function that is called
from many places, but where one is only interested in
the call from a specific function, e.g., (RPLACA IN
FOO), (PRINT IN FIE), etc. This only works in
interpreted functions.
ERROR PACKAGE _____________
| The error package is enabled by EVALing (DEBUG T). When an error
occurs during the evaluation of a LISP expression, control is turned
over to the error package. The idea behind the error package is that it
may be possible to "patch up" the form in which the error occurred and
| continue. Or, at least, the user may find the cause of the error more
easily if he can examine the state of the world at the time of the
error. Basically, what the error package does is call BREAKFUNCTION
with BREAKEXPR set to the form in which the error occurred. This puts
the user "in a break" around the form in which the error occurred.
BREAKFUNCTION acts just like the top level of the interpreter with some
added commands (see the section on BREAKFUNCTION). The main difference
| when the error package is enabled is that the variable bindings that
were in effect when the error occurred are still in effect. Further-
more, the expressions that were in the process of evaluation are still
| pending. While the error package is enabled, variables may be examined
or changed, and functions may be defined or edited just as if the user
were at the top level. In addition, there are several ways in which the
user can abort or continue from the point of error. In particular, if
the error can be patched up, entering "OK" will cause the program to
continue. If the error can’t be fixed, # will cause the program to exit
from the break. When the error package is being used, the prompt
character is (=); this is preceded by a level number. Note: If for
some reason, the error package is not to be invoked, it can be disabled
| by evaluating (DEBUG NIL).
LISP Debugging Facilities 109
Previous Page Next Page