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
nilor 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 tonilto 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
sbclextension similar to the standard*debugger-hook*. In contrast to*debugger-hook*, it is observed byinvoke-debuggereven when called bybreak.