changes in the way interrupt code works
[unix-history] / .ref-BSD-3 / usr / doc / lisp / ch11.n
CommitLineData
550cf40a
JF
1.Lc The\ Joseph\ Lister\ Trace\ Package 11
2.de Tf
3.sp 2v
4.ti -.5i
5\fB\\$1\fP -
6..
7.pp
8The trace package is an important tool for interactive debugging of a Lisp
9program.
10It allows you to examine selected calls to a function or functions, and
11optionally to stop execution of the Lisp program to examine the contents
12of variables.
13.pp
14The trace package is a set of Lisp programs located in the Lisp program
15library (usually in the file /usr/lib/lisp/trace.l).
16To load the trace package into Lisp, type
17.b "(load 'trace)" .
18There are two user callable functions in the trace package:
19.i trace
20and
21.i untrace .
22Both functions are nlambdas (their arguments are not evaluated).
23The form of a call to
24.i trace
25is
26.br
27.tl ''\fB(trace \fIarg1 arg2 ...\fB)\fR''
28where the
29.i argi
30have one of the following forms:
31.in .75i
32.Tf "foo"
33when foo is entered and exited, the trace information will be printed.
34.Tf "(foo break)"
35when foo is entered and exited the trace information will be printed.
36Also, just after the trace information for foo is printed upon entry,
37you will be put in a special break loop.
38The prompt is `T>' and you may type and Lisp expression, and see its
39value printed.
40The
41.i i th
42argument to the function just called can be accessed as (arg i).
43To leave the trace loop, just type ^D and execution will continue.
44.Tf "(foo if expression)"
45when foo is entered and the expression evaluates to non nil, then the
46trace information will be printed for both exit and entry.
47If expression evaluates to nil, then no trace information will be
48printed.
49.Tf "(foo ifnot expression)"
50when foo is entered and the expression evaluates to nil, then the
51trace information will be printed for both entry and exit.
52.Tf "(foo evalin expression)"
53when foo is entered and after the entry trace information is printed,
54expression will be evaluated.
55Exit trace information will be printed when foo exits.
56.Tf "(foo evalout expression)"
57when foo is entered, entry trace information will be printed.
58When foo exits, and before the exit trace information is printed,
59expression will be evaluated.
60.Tf "(foo evalinout expression)"
61this has the same effect as (trace (foo evalin expression evalout expression)).