From 9516724783ecc037f9676cd295a85b358f9846b7 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Fri, 25 Feb 2005 22:06:20 +0000
Subject: [PATCH] Document tracing of methods better and include an example of
 using the :wherein option with methods.

---
 docs/cmu-user/debugger.tex   |  7 ++++++-
 docs/cmu-user/extensions.tex | 22 ++++++++++++++++++----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/docs/cmu-user/debugger.tex b/docs/cmu-user/debugger.tex
index 8494cbcfa..4a9698487 100644
--- a/docs/cmu-user/debugger.tex
+++ b/docs/cmu-user/debugger.tex
@@ -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
diff --git a/docs/cmu-user/extensions.tex b/docs/cmu-user/extensions.tex
index ad0d260a4..1dd930955 100644
--- a/docs/cmu-user/extensions.tex
+++ b/docs/cmu-user/extensions.tex
@@ -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
-- 
GitLab