This section describes some of the common problems seen when tracing, with suggestions to overcome these.
In general it is not useful to trace cl:length
and other base-level functions unconditionally because they are called too frequently by LispWorks itself.
It may be useful to trace these functions in a limited fashion, using the trace options :inside or :when.
There are two common reasons for not seeing calls you expect in trace output.
There are many other optimizations built-in to the LispWorks compiler, which affect code generated according to the compiler qualities in effect at compile-time. For example if the compiler was set to inline structure accessors, then tracing structure accessors in code compiled with that setting will produce no output.
While debugging, you could re-compile the code at higher safety or run it interpreted, to obtain the trace output.
trace works by tracing function names, not function objects.
Therefore tracing function objects, for example by
(trace #'foo)
will not yield any trace output. Instead you need to do
(trace foo)
Also, if the symbol foo
is traced, then code which invokes foo
by
(funcall (symbol-function 'foo) ...)
(funcall #'foo ...)
will not produce any trace output.
The correct approach is to use (funcall 'foo ...)
instead of (funcall #'foo ...)
.
LispWorks User Guide and Reference Manual - 13 Feb 2015