with-debugger-wrapper executes forms in body with the function wrapper bound as a "debugger wrapper". This debugger wrapper takes effect only if the code in body tries to invoke the debugger (by a call to
invoke-debugger), typically indirectly as a result of an error. Instead of entering the debugger, the debugger wrapper is called with two arguments: a function to call to enter the debugger, and the condition. The wrapper can do whatever is needed. If it wants to enter the debugger, it does it by calling its first argument with the second argument:
(funcall function condition)
Suppose that you run many processes in parallel with the same code. If the code is broken then every process will get an error. This example shows how a debugger wrapper can be used to keep a lock around entry to the debugger, so that the processes enter the debugger one by one. It contains firstly the "application code", then the debugger wrapper, and lastly forms which execute the application with or without the debugger wrapper.
LispWorks User Guide and Reference Manual - 13 Feb 2015