Home

Awesome

trivial-custom-debugger

Description

This is a portability library that allows one to fully override the standard debugger provided by their Common Lisp system for situations where binding *debugger-hook* is not enough - most notably, for #'break.

Inside the debugger function:

Purpose

A basic building block that allows one to implement a portable, custom debugger for Common Lisp systems in place of the original system-provided one.

Example

TRIVIAL-CUSTOM-DEBUGGER> (with-debugger ((lambda (condition hook)
                                           (declare (ignore hook))
                                           (format t ";; Debugging a ~S!~%" 
                                                   (type-of condition))
                                           (throw :handled t)))
                           (list (catch :handled (error 'error))
                                 (catch :handled (break))
                                 (let ((*break-on-signals* 'error))
                                   (catch :handled (signal 'error)))
                                 (catch :handled 
                                   (invoke-debugger (make-condition 'error)))))
;; Debugging a ERROR!
;; Debugging a SIMPLE-CONDITION!
;; Debugging a SIMPLE-CONDITION!
;; Debugging a ERROR!
(T T T T)

Limitations

Inside with-debugger or after calling install:

Tests

Very roughly tested on SBCL, CCL, ECL, Clasp, ABCL, CLISP, ACL, LispWorks, and Mezzano.

To run the test suite, evaluate (asdf:test-system :trivial-custom-debugger).