While using Edebug, you can specify breakpoints in the program you are testing: these are places where execution should stop. You can set a breakpoint at any stop point, as defined in Using Edebug. For setting and unsetting breakpoints, the stop point that is affected is the first one at or after point in the source code buffer. Here are the Edebug commands for breakpoints:
Set a breakpoint at the stop point at or after point
(edebug-set-breakpoint
). If you use a prefix argument, the
breakpoint is temporary—it turns off the first time it stops the
program. An overlay with the edebug-enabled-breakpoint
or
edebug-disabled-breakpoint
faces is put at the breakpoint.
Unset the breakpoint (if any) at the stop point at or after
point (edebug-unset-breakpoint
).
Unset any breakpoints in the current form
(edebug-unset-breakpoints
).
Toggle whether to disable the breakpoint near point
(edebug-toggle-disable-breakpoint
). This command is mostly
useful if the breakpoint is conditional and it would take some work to
recreate the condition.
Set a conditional breakpoint which stops the program only if
evaluating condition produces a non-nil
value
(edebug-set-conditional-breakpoint
). With a prefix argument,
the breakpoint is temporary.
Move point to the next breakpoint in the current definition
(edebug-next-breakpoint
).
While in Edebug, you can set a breakpoint with b and unset one with u. First move point to the Edebug stop point of your choice, then type b or u to set or unset a breakpoint there. Unsetting a breakpoint where none has been set has no effect.
Re-evaluating or reinstrumenting a definition removes all of its previous breakpoints.
A conditional breakpoint tests a condition each time the program
gets there. Any errors that occur as a result of evaluating the
condition are ignored, as if the result were nil
. To set a
conditional breakpoint, use x, and specify the condition
expression in the minibuffer. Setting a conditional breakpoint at a
stop point that has a previously established conditional breakpoint puts
the previous condition expression in the minibuffer so you can edit it.
You can make a conditional or unconditional breakpoint temporary by using a prefix argument with the command to set the breakpoint. When a temporary breakpoint stops the program, it is automatically unset.
Edebug always stops or pauses at a breakpoint, except when the Edebug mode is Go-nonstop. In that mode, it ignores breakpoints entirely.
To find out where your breakpoints are, use the B command, which moves point to the next breakpoint following point, within the same function, or to the first breakpoint if there are no following breakpoints. This command does not continue execution—it just moves point in the buffer.