[slime-cvs] CVS update: slime/swank.lisp slime/swank-sbcl.lisp slime/swank-openmcl.lisp slime/swank-cmucl.lisp

Luke Gorrie lgorrie at common-lisp.net
Sun Nov 23 14:16:42 UTC 2003


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv19134

Modified Files:
	swank.lisp swank-sbcl.lisp swank-openmcl.lisp swank-cmucl.lisp 
Log Message:
Updated to use new debugger interfaces in swank-backend.lisp.

Date: Sun Nov 23 09:16:42 2003
Author: lgorrie

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.63 slime/swank.lisp:1.64
--- slime/swank.lisp:1.63	Sun Nov 23 07:28:43 2003
+++ slime/swank.lisp	Sun Nov 23 09:16:42 2003
@@ -17,7 +17,10 @@
 (in-package :swank)
 
 ;; Directly exported backend functions.
-(export '(arglist-string))
+(export '(arglist-string backtrace function-source-location-for-emacs
+          frame-locals frame-catch-tags frame-source-position
+          frame-source-location-for-emacs
+          eval-in-frame eval-string-in-frame))
 
 (defvar *swank-io-package*
   (let ((package (make-package "SWANK-IO-PACKAGE")))
@@ -262,6 +265,9 @@
 
 (defslimefun sldb-continue ()
   (continue *swank-debugger-condition*))
+
+(defslimefun eval-string-in-frame (string index)
+  (to-string (swank-backend:eval-in-frame (from-string string) index)))
 
 
 ;;;; Evaluation


Index: slime/swank-sbcl.lisp
diff -u slime/swank-sbcl.lisp:1.25 slime/swank-sbcl.lisp:1.26
--- slime/swank-sbcl.lisp:1.25	Sun Nov 23 07:14:04 2003
+++ slime/swank-sbcl.lisp	Sun Nov 23 09:16:42 2003
@@ -180,7 +180,7 @@
   (setf *default-pathname-defaults* (merge-pathnames directory))
   (namestring *default-pathname-defaults*))
 
-(defslimefun arglist-string (fname)
+(defmethod arglist-string (fname)
   (let ((*print-case* :downcase))
     (multiple-value-bind (function condition)
         (ignore-errors (values 
@@ -332,7 +332,7 @@
           ;; for emacs to attempt to find with a regex
           :function-name (unless path fname))))
                                 
-(defslimefun function-source-location-for-emacs (fname-string)
+(defmethod function-source-location-for-emacs (fname-string)
   "Return the source-location of FNAME's definition."
   (let* ((fname (from-string fname-string)))
     (labels ((finder (fname)
@@ -475,13 +475,13 @@
 	       while f
 	       collect f)))))
 
-(defslimefun backtrace-for-emacs (start end)
+(defmethod backtrace (start end)
   (mapcar #'format-frame-for-emacs (compute-backtrace start end)))
 
 (defmethod debugger-info-for-emacs (start end)
   (list (format-condition-for-emacs)
 	(format-restarts-for-emacs)
-	(backtrace-for-emacs start end)))
+	(backtrace start end)))
 
 (defun code-location-source-path (code-location)
   (let* ((location (sb-debug::maybe-block-start-location code-location))
@@ -536,15 +536,15 @@
   (handler-case (source-location-for-emacs code-location)
     (t (c) (list :error (princ-to-string c)))))
 
-(defslimefun frame-source-location-for-emacs (index)
+(defmethod frame-source-location-for-emacs (index)
   (safe-source-location-for-emacs 
    (sb-di:frame-code-location (nth-frame index))))
 
 #+nil
-(defslimefun eval-string-in-frame (string index)
-  (to-string (sb-di:eval-in-frame (nth-frame index) (from-string string))))
+(defmethod eval-in-frame (form index)
+  (sb-di:eval-in-frame (nth-frame index) string))
 
-(defslimefun frame-locals (index)
+(defmethod frame-locals (index)
   (let* ((frame (nth-frame index))
 	 (location (sb-di:frame-code-location frame))
 	 (debug-function (sb-di:frame-debug-fun frame))
@@ -560,7 +560,7 @@
                        (to-string (sb-di:debug-var-value v frame))
                        "<not-available>")))))
 
-(defslimefun frame-catch-tags (index)
+(defmethod frame-catch-tags (index)
   (loop for (tag . code-location) in (sb-di:frame-catches (nth-frame index))
 	collect `(,tag . ,(safe-source-location-for-emacs code-location))))
 


Index: slime/swank-openmcl.lisp
diff -u slime/swank-openmcl.lisp:1.23 slime/swank-openmcl.lisp:1.24
--- slime/swank-openmcl.lisp:1.23	Sun Nov 23 07:14:04 2003
+++ slime/swank-openmcl.lisp	Sun Nov 23 09:16:42 2003
@@ -13,7 +13,7 @@
 ;;; The LLGPL is also available online at
 ;;; http://opensource.franz.com/preamble.html
 ;;;
-;;;   $Id: swank-openmcl.lisp,v 1.23 2003/11/23 12:14:04 lgorrie Exp $
+;;;   $Id: swank-openmcl.lisp,v 1.24 2003/11/23 14:16:42 lgorrie Exp $
 ;;;
 
 ;;;
@@ -256,9 +256,7 @@
                            result))))))
         (format nil "~{ ~A~}" (nreverse result)))))
 
-(defslimefun backtrace-for-emacs (&optional
-                  (start-frame-number 0)
-                  (end-frame-number most-positive-fixnum))
+(defmethod backtrace (start-frame-number end-frame-number)
   "Return a list containing a stack backtrace of the condition
 currently being debugged.  The return value of this function is
 unspecified unless called in the dynamic contour of a function
@@ -294,9 +292,9 @@
 (defmethod debugger-info-for-emacs (start end)
   (list (format-condition-for-emacs)
         (format-restarts-for-emacs)
-        (backtrace-for-emacs start end)))
+        (backtrace start end)))
 
-(defslimefun frame-locals (index)
+(defmethod frame-locals (index)
   (map-backtrace 
    #'(lambda (frame-number p tcr lfun pc)
        (when (= frame-number index)
@@ -316,7 +314,7 @@
                          result))))
              (return-from frame-locals (nreverse result))))))))
 
-(defslimefun frame-catch-tags (index)
+(defmethod frame-catch-tags (index)
   (declare (ignore index))
   nil)
 
@@ -330,7 +328,7 @@
       (let ((filename (namestring (truename source-info))))
         (list :openmcl filename (symbol-name symbol))))))
 
-(defslimefun frame-source-location-for-emacs (index)
+(defmethod frame-source-location-for-emacs (index)
   "Return to Emacs the location of the source code for the
 function in a debugger frame.  In OpenMCL, we are not able to
 find the precise position of the frame, but we do attempt to give


Index: slime/swank-cmucl.lisp
diff -u slime/swank-cmucl.lisp:1.25 slime/swank-cmucl.lisp:1.26
--- slime/swank-cmucl.lisp:1.25	Sun Nov 23 07:14:04 2003
+++ slime/swank-cmucl.lisp	Sun Nov 23 09:16:42 2003
@@ -530,7 +530,7 @@
            (when location
              (source-location-for-emacs location))))))
 
-(defslimefun function-source-location-for-emacs (fname)
+(defmethod function-source-location-for-emacs (fname)
   "Return the source-location of FNAME's definition."
   (let* ((fname (from-string fname))
          (finder
@@ -904,19 +904,19 @@
 	  while f
 	  collect f)))
 
-(defslimefun backtrace-for-emacs (start end)
+(defmethod backtrace (start end)
   (mapcar #'format-frame-for-emacs (compute-backtrace start end)))
 
 (defmethod debugger-info-for-emacs (start end)
   (list (format-condition-for-emacs)
 	(format-restarts-for-emacs)
-	(backtrace-for-emacs start end)))
+	(backtrace start end)))
 
-(defslimefun frame-source-location-for-emacs (index)
+(defmethod frame-source-location-for-emacs (index)
   (safe-source-location-for-emacs (di:frame-code-location (nth-frame index))))
 
-(defslimefun eval-string-in-frame (string index)
-  (to-string (di:eval-in-frame (nth-frame index) (from-string string))))
+(defmethod eval-in-frame (form index)
+  (di:eval-in-frame (nth-frame index) form))
 
 (defslimefun pprint-eval-string-in-frame (string index)
   (swank-pprint 
@@ -927,7 +927,7 @@
   (reset-inspector)
   (inspect-object (di:eval-in-frame (nth-frame index) (from-string string))))
 
-(defslimefun frame-locals (index)
+(defmethod frame-locals (index)
   (let* ((frame (nth-frame index))
 	 (location (di:frame-code-location frame))
 	 (debug-function (di:frame-debug-function frame))
@@ -942,7 +942,7 @@
 		       (to-string (di:debug-variable-value v frame))
 		       "<not-available>")))))
 
-(defslimefun frame-catch-tags (index)
+(defmethod frame-catch-tags (index)
   (loop for (tag . code-location) in (di:frame-catches (nth-frame index))
 	collect `(,tag . ,(safe-source-location-for-emacs code-location))))
 





More information about the slime-cvs mailing list