Debugger mode is the mode used in the BacktraceBuffer (buffer ‘*Backtrace*’). It shows the “frames” of your execution stack. A line starts with ‘*’ if exiting that frame will call the debugger.
‘C-h m’ gives you information on the current mode.
b
break point – place an asterisk (‘*’) on a stack frame
u
remove break point
c
continue
d
single step
j
keep existing frames until you reach the current frame
e
eval another sexp that you input
q
quit
M-x debug-on-entry
to put breakpoints at the start of
functions, and M-x cancel-debug-on-entry
to remove them.
(debug)
in EmacsLisp code at arbitrary points (and then eval
that code) to put breakpoints at those places.
Debugger is entered when the user hits ‘C-g’. This is
useful in debugging infinite loops and long delays. You
can toggle this variable using M-x toggle-debug-on-quit
.
Debugger is entered when an uncaught error happens. This
is foiled by condition-case forms that catch errors. You
can toggle this variable using ‘M-x
toggle-debug-on-error’. Note that some errors are
ignored — you may have to temporarily set
debug-ignored-errors
to ‘nil’ in order to debug such
errors.
An alternative to debug-on-error
. It shows trace buffers instead of
entering the debugger. Example: (setq stack-trace-on-error
'(buffer-read-only))