[slime-devel] Slime-2.0 broken in clisp-2.44

Mark Harig idirectscm at aim.com
Fri Feb 8 20:40:44 UTC 2008


Jean-Claude Beaudoin wrote:
>
> Hello everyone,
>
> It seems that version 2.44 of clisp broke slime 2.0.
>
> Here is my quick and dirty fix for it:
>
According to the ChangeLog for CLISP version 2.44, both FRAME-UP-1 and
FRAME-DOWN-1 have been removed:

2008-01-15  Sam Steingold  <sds at gnu.org>
 
  * debug.d (climb_stack_once, climb_stack_repeat): merge into climb_stack
  (FRAME-UP-1, FRAME-DOWN-1): remove
  (FRAME-UP, FRAME-DOWN): accept an additional REPEAT argument
  * reploop.lisp (frame-limit-down, frame-limit-up, debug-up)
  (debug-top, debug-down, debug-bottom, frame-up-down):
  use (frame-up 1 ...) instead of (frame-up-1 ...)
  and (frame-down 1 ...) instead of (frame-down-1 ...)
  and (frame-up t ...) instead of (frame-up ...)
  and (frame-down t ...) instead of (frame-down ...)
  (print-backtrace): use ~:P in message
  * constsym.d, subr.d (frame_up_1, frame_down_1): remove

Here is a patch file for the latest revision of swank-clisp.lisp (1.65) 
that adds the
implementation-specific code suggested by Jean-Claude Beaudoin, but with
additional code for FRAME-DOWN/FRAME-DOWN-1.  It also moves
the function definition for SLDB-BACKTRACE before the first reference to 
it to
eliminate a compiler warning.

-------------- next part --------------
--- swank-clisp.lisp-1.65   2008-02-08 15:15:33.375000000 -0500
+++ swank-clisp.lisp    2008-02-08 15:21:20.609375000 -0500
@@ -249,6 +249,21 @@
 
 (defvar *sldb-backtrace*)
 
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (when (string< "2.44" (lisp-implementation-version))
+    (pushnew :clisp-2.44+ *features*)))
+
+(defun sldb-backtrace ()
+  "Return a list ((ADDRESS . DESCRIPTION) ...) of frames."
+  (do ((frames '())
+       (last nil frame)
+       (frame (sys::the-frame)
+              #+clisp-2.44+ (sys::frame-up 1 frame 1)
+              #-clisp-2.44+ (sys::frame-up-1 frame 1))) ; 1 = "all frames"
+      ((eq frame last) (nreverse frames))
+    (unless (boring-frame-p frame)
+      (push frame frames))))
+
 (defimplementation call-with-debugging-environment (debugger-loop-fn)
   (let* (;;(sys::*break-count* (1+ sys::*break-count*))
          ;;(sys::*driver* debugger-loop-fn)
@@ -260,15 +275,6 @@
 (defun nth-frame (index)
   (nth index *sldb-backtrace*))
 
-(defun sldb-backtrace ()
-  "Return a list ((ADDRESS . DESCRIPTION) ...) of frames."
-  (do ((frames '())
-       (last nil frame)
-       (frame (sys::the-frame) (sys::frame-up-1 frame 1))) ; 1 = "all frames"
-      ((eq frame last) (nreverse frames))
-    (unless (boring-frame-p frame)
-      (push frame frames))))
-
 (defun boring-frame-p (frame)
   (member (frame-type frame) '(stack-value bind-var bind-env)))
 
@@ -418,7 +424,9 @@
         (venv-ref (next-venv env) (- i (/ (1- (length env)) 2))))))
 
 (defun %parse-stack-values (frame)
-  (labels ((next (fp) (sys::frame-down-1 fp 1))
+  (labels ((next (fp)
+             #+clisp-2.44+ (sys::frame-down 1 fp 1)
+             #-clisp-2.44+ (sys::frame-down-1 fp 1))
            (parse (fp accu)
              (let ((str (frame-to-string fp)))
                (cond ((is-prefix-p "- " str)
@@ -433,6 +441,8 @@
                      (t (parse (next fp) accu))))))
     (parse (next frame) '())))
 
+(setq *features* (remove :clisp-2.44+ *features*))
+
 (defun is-prefix-p (pattern string)
   (not (mismatch pattern string :end2 (min (length pattern)
                                            (length string)))))


More information about the slime-devel mailing list