Previous: Debugger Banner, Up: Debugger Entry
The debugger is invoked when:
error
is called, and the condition it signals is not handled.
break
is called, or signal
is called with a condition
that matches the current *break-on-signals*
.
invoke-debugger
function.
When the debugger is invoked by a condition, ANSI mandates that the
value of *debugger-hook*
, if any, be called with two arguments:
the condition that caused the debugger to be invoked and the previous
value of *debugger-hook*
. When this happens,
*debugger-hook*
is bound to NIL to prevent recursive errors.
However, ANSI also mandates that *debugger-hook*
not be invoked
when the debugger is to be entered by the break
function. For
users who wish to provide an alternate debugger interface (and thus
catch break
entries into the debugger), SBCL provides
sb-ext:*invoke-debugger-hook*
, which is invoked during any
entry into the debugger.
This is either
nil
or a designator for a function of two arguments, to be run when the debugger is about to be entered. The function is run with*invoke-debugger-hook*
bound tonil
to minimize recursive errors, and receives as arguments the condition that triggered debugger entry and the previous value of*invoke-debugger-hook*
This mechanism is an
sbcl
extension similar to the standard*debugger-hook*
. In contrast to*debugger-hook*
, it is observed byinvoke-debugger
even when called bybreak
.