[slime-devel] Re: new debugger behavior?

Carlos Konstanski ckonstanski at pippiandcarlos.com
Mon Aug 11 14:24:57 UTC 2008


Tobias C. Rittweiler writes:
 > Carlos Konstanski <ckonstanski at pippiandcarlos.com> writes:
 > 
 > > My suggestion: have the ability to choose between today's
 > > *debugger-hook* functionality (honor the debugee application's
 > > condition handling), and that of the pre-April era (unconditionally
 > > override the debugee application's condition handling).  It would be
 > > nice to have the choice to debug any application without concern for
 > > how that application handles conditions internally.
 > 
 > There should be a ARANEIDA:*TRAP-INTO-DEBUGGER* which you can set to T,
 > and if it's T araneida's DEBUGGER-HOOK should invoke its old value
 > (which is passed along side the condition in fact.) This is
 > application's domain, not something we could do much about.
 > 
 >   -T.
 > 
 > PS: That said, with SBCL you could place
 > 
 >   #+sbcl (setf sb-ext:*invoke-debugger-hook* swank:swank-debugger-hook)
 > 
 > into your ~/.swank.lisp to overwrite any application-specific
 > debugger-hook.

This suggestion looked very promising.  If it were that easy, it would
be exactly what I desired.  Unfortunately, .swank.lisp gets loaded too
early, and swank:swank-debugger-hook is unbound at that time.

I found the right spot in araneida to put this function call, however.
I'll show it here for any araneida users out there.  In
http-listener.lisp:

(defmacro with-accept-flets (&body body)
  `(labels ((do-it (listener s)
           (let ((r (read-request-from-stream listener s)))
             (handler-case
              (handle-request-using-listener
               listener (http-listener-handler listener) r)
              (response-sent () nil)
              (http-error (c)
              (request-send-error r (http-error-code c)
                              :log-message (http-error-message c)
                              :client-message (http-error-client-message c))))))
        (accept (listener)
            (listener-accept-stream listener)))
       (with-simple-restart
        (abort-response "Abort this response and answer another request")
        ;; expectation is that socket-accept will not block, because we 
        ;; are invoked when select() says something is ready.  we really
        ;; ought to set the master socket non-blocking to be sure.
        (let ((*debugger-hook* (if (and (find-package :swank) 
                                        (functionp #'swank:swank-debugger-hook))
                                   #'swank:swank-debugger-hook
                                   #'handler-debugger-hook)))
          , at body))))

Danke sehr für Ihre Hilfe!  Jetzt kann ich wieder fehlhafter lisp schreiben!
-- 
Carlos



More information about the slime-devel mailing list