
(defun bug ()
  (block nil
    (handler-bind ((error (lambda (cond)
                            (collect-backtrace cond)
                            (return))))
      (error "XXXXXXXXXXXXXXXXXXX"))))



(defun collect-backtrace (condition)
  (let ((swank::*swank-debugger-condition* condition)
        (swank::*buffer-package* *package*))
    (swank::call-with-debugging-environment 
     (lambda () 
       (loop
        for (index desc) in (swank:backtrace 4 500)
        do (format t "~A ~A~&" index desc))))))

(bug)

