[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tracing a method
- To: info-mcl@cambridge.apple.com
- Subject: Re: tracing a method
- From: moeller@informatik.uni-hamburg.de (Ralf Moeller)
- Date: Thu, 8 Oct 1992 14:10:34 +0100
- Cc: lynch@ils.nwu.edu
- Sender: moeller@kogs26.informatik.uni-hamburg.de
Rich lynch@ils.nwu.edu writes...
>What is the correct syntax to put a step-point on a method?
The following code will allow tracing of methods to be
enabled/disabled using the generic function inspector.
No need to remember the syntax :-)
Ralf
;;;; inspector extensions
(in-package inspector)
(defmethod inspector-commands ((f gf-inspector))
(let* ((commands (call-next-method f))
(function (inspector-object f))
(methods (generic-function-methods (inspector-object f)))
(view (inspector-view f))
(selection (selection view)))
(append
commands
(list
`("-" nil)
`("Remove method"
,(and selection (> selection 3)
#'(lambda ()
(remove-method function (elt methods (- selection 4)))
(resample-it))))
`("Trace method"
,(and selection (> selection 3)
#'(lambda ()
(let ((method (elt methods (- selection 4))))
(ccl::%trace-0
`(((:method ,(method-name method)
,@(method-qualifiers method)
,(mapcar #'class-name
(method-specializers
method))))))))))
`("Untrace method"
,(and selection (> selection 3)
#'(lambda ()
(let ((method (elt methods (- selection 4))))
(ccl::%untrace-0
`((:method ,(method-name method)
,@(method-qualifiers method)
,(mapcar #'class-name
(method-specializers
method)))))))))))))