デバッガを起動すると、以前に選択されていたバッファが一方のウィンドウに、*Backtrace* という名前のバッファがもう一方のウィンドウに表示されます。バックトレースバッファには、現在実行中の Lisp 関数の各レベルにつき 1 行ずつ記録されます。このバッファの先頭には、デバッガが呼び出された理由を説明するメッセージ(エラーにより呼び出された場合は、エラーメッセージや関連データなど)が表示されます。
The backtrace buffer is read-only and uses a special major mode, Debugger
mode, in which letters are defined as debugger commands. The usual Emacs
editing commands are available; thus, you can switch windows to examine the
buffer that was being edited at the time of the error, switch buffers, visit
files, or do any other sort of editing. However, the debugger is a
recursive editing level (see Recursive Editing) and it is wise to go
back to the backtrace buffer and exit the debugger (with the q command) when you are finished with it. Exiting the
debugger gets out of the recursive edit and buries the backtrace buffer.
(You can customize what the q command does with the
backtrace buffer by setting the variable debugger-bury-or-kill. For example, set it to kill if you prefer to kill the buffer rather than bury
it. Consult the variable’s documentation for more possibilities.)
デバッガに入った際、debug-on-error 変数は eval-expression-debug-on-error に応じて一時的に設定されます。後者の変数が
nil 以外の場合、debug-on-error
は一時的に t
に設定されます。ただし、デバッグ中に発生した後続のエラーによって(デフォルトでは)別のデバッガが起動することはありません。これは、inhibit-debugger も nil
以外にバインドされるためです。
デバッガ自体は、Lispインタプリタの状態について前提を置いているため、バイトコンパイル状態で実行する必要があります。デバッガをインタプリタモードで実行している場合、これらの前提は成立しません。