/[slime]/slime/swank-sbcl.lisp
ViewVC logotype

Diff of /slime/swank-sbcl.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.116 by heller, Mon Jan 10 19:33:29 2005 UTC revision 1.117 by mbaringer, Fri Feb 18 16:04:13 2005 UTC
# Line 935  stack." Line 935  stack."
935                                                mutex))))))))                                                mutex))))))))
936    
937    )    )
938    
939    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
940    ;;Trace implementations
941    ;;In SBCL, we have:
942    ;; (trace <name>)
943    ;; (trace :methods '<name>) ;;to trace all methods of the gf <name>
944    ;; (trace (method <name> <qualifier>? (<specializer>+)))
945    ;; <name> can be a normal name or a (setf name)
946    
947    
948    (defun toggle-trace (fspec &rest args)
949      (cond ((member fspec (eval '(trace)) :test #'equal)
950             (eval `(untrace ,fspec))
951             (format nil "~S is now untraced." fspec))
952            (t
953             (eval `(trace ,@(if args `(:encapsulate nil) (list)) ,fspec ,@args))
954             (format nil "~S is now traced." fspec))))
955    
956    (defimplementation toggle-trace-generic-function-methods (name)
957      (toggle-trace name :methods t))
958    
959    (defun process-fspec (fspec)
960      (cond ((consp fspec)
961             (ecase (first fspec)
962               ((:defun :defgeneric) (second fspec))
963               ((:defmethod) `(method ,@(rest fspec)))
964               ((:labels) `(labels ,(process-fspec (second fspec)) ,(third fspec)))
965               ((:flet) `(flet ,(process-fspec (second fspec)) ,(third fspec)))))
966            (t
967             fspec)))
968    
969    (defimplementation toggle-trace-function (spec)
970      (toggle-trace spec))
971    
972    (defimplementation toggle-trace-method (spec)
973      (toggle-trace `(sb-pcl::fast-method ,@(rest (process-fspec spec)))))
974    
975    (defimplementation toggle-trace-fdefinition-wherein (name wherein)
976      (toggle-trace name :wherein (process-fspec wherein)))

Legend:
Removed from v.1.116  
changed lines
  Added in v.1.117

  ViewVC Help
Powered by ViewVC 1.1.5