Next: Trapping Errors, Previous: Edebug Misc, Up: Edebug [Contents][Index]
There are three more ways to stop execution once it has started: breakpoints, the global break condition, and embedded breakpoints.
While using Edebug, you can specify breakpoints in the program you are testing: points 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).
Unset the breakpoint (if any) at the stop point at or after the current
point (edebug-unset-breakpoint
).
Set a conditional breakpoint which stops the program only if
condition evaluates to a non-nil
value
(edebug-set-conditional-breakpoint
). If you use a prefix
argument, the breakpoint is temporary (it turns off the first time it
stops the program).
Move point to the next breakpoint in the definition
(edebug-next-breakpoint
).
While in Edebug, you can set a breakpoint with b and unset one with u. First you must move point to a position at or before the desired Edebug stop point, then hit the key to change the breakpoint. Unsetting a breakpoint that has not been set does nothing.
Reevaluating or reinstrumenting a definition clears all its breakpoints.
A conditional breakpoint tests a condition each time the program gets there. To set a conditional breakpoint, use x, and specify the condition expression in the minibuffer. Setting a conditional breakpoint at a stop point that already has a conditional breakpoint puts the current condition expression in the minibuffer so you can edit it.
You can make both conditional and unconditional breakpoints temporary by using a prefix arg to the command to set the breakpoint. After breaking at a temporary breakpoint, it is automatically cleared.
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 B, which moves point to the next breakpoint in the definition following point, or to the first breakpoint if there are no following breakpoints. This command does not continue execution—it just moves point in the buffer.
• Global Break Condition: | Breaking on an event. | |
• Embedded Breakpoints: | Embedding breakpoints in code. |
Next: Trapping Errors, Previous: Edebug Misc, Up: Edebug [Contents][Index]