Skip to content
Snippets Groups Projects
Commit 95167247 authored by rtoy's avatar rtoy
Browse files

Document tracing of methods better and include an example of using the

:wherein option with methods.
parent 256bf25a
No related branches found
No related tags found
No related merge requests found
......@@ -1014,6 +1014,10 @@ function entry or exit.
of arguments and return values is controlled by
\vindexed{debug-print-level} and \vindexed{debug-print-length}.
Invidiual methods can also be traced using the syntax \code{(method
<name> <qualifiers> <specializers>)}.
See~\ref{sec:method-tracing} for more information.
If no \var{names} or \var{options} are are given, \code{trace}
returns the list of all currently traced functions,
\code{*traced-function-list*}.
......@@ -1039,7 +1043,8 @@ function entry or exit.
function name or list of names. \code{trace} does nothing unless
a call to one of those functions encloses the call to this
function (i.e. it would appear in a backtrace.) Anonymous
functions have string names like \code{"DEFUN FOO"}.
functions have string names like \code{"DEFUN FOO"}. Individual
methods can also be traced. See section~\ref{sec:method-tracing}.
\item[\kwd{break} \var{form}, \kwd{break-after} \var{form},
\kwd{break-all} \var{form}] If specified, and \var{form} evaluates
......
......@@ -2310,6 +2310,7 @@ implemented. Please note that this interface is subject to change.
\subsection{Method Tracing and Profiling}
\label{sec:method-tracing}
\cindex{tracing}
\cpsubindex{tracing}{methods}
\cindex{profiling}
......@@ -2318,7 +2319,7 @@ implemented. Please note that this interface is subject to change.
\cpsubindex{methods}{profiling}
Methods can be traced with \code{trace}, using function names of the
form \verb|(method <qualifiers> <specializers>)|. Example:
form \code{(method <name> <qualifiers> <specializers>)}. Example:
\begin{example}
(defmethod foo ((x integer)) x)
......@@ -2337,6 +2338,19 @@ form \verb|(method <qualifiers> <specializers>)|. Example:
(untrace :methods 'foo)
\end{example}
Methods can also be specified for the \kwd{wherein} option to
\code{trace}. Because this option is a name or a list of names,
methods must be specified as a list. Thus, to trace all calls of
\code{foo} from the method \code{bar} specialized on integer argument,
use
\begin{example}
(trace foo :wherein ((method bar (integer))))
\end{example}
Before and after methods are supported as well:
\begin{example}
(trace foo :wherein ((method bar :before (integer))))
\end{example}
Method profiling is done analogously to \code{trace}:
\begin{example}
......@@ -2443,10 +2457,10 @@ innermost fwrapper.
In \var{body}, the symbol \code{fwrapper} is bound to the current
fwrapper object.
The macro \code{call-next-function} can be used to invoke the next
fwrapper, or the primary function being fwrapped. When called
with no arguments, \code{call-next-function} invokes the next
fwrapper, or the primary function that is being fwrapped. When
called with no arguments, \code{call-next-function} invokes the next
function with the original arguments passed to the fwrapper, unless
you modify one of the parameters. When called with arguments,
\code{call-next-function} invokes the next function with the given
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment