Even with a convenient debug key prefix enabled, repetitive stepping, variable examination (see Examining Variables), and other debugging activities can be awkward and slow using commands which require multiple keystrokes. Luckily, there's a better way, inspired by the lisp e-debug mode, and available through the Electric Debug Mode. By default, as soon as a breakpoint is hit, this minor mode is enabled. The buffer showing the line where execution has halted is switched to Electric Debug Mode. This mode is visible as ‘*Debugging*’ in the mode line, and a different face (violet by default, if color is available) for the line stopped at point. The buffer is made read-only and single-character bindings for the most commonly used debugging commands are enabled. These character commands (a list of which is available with C-?) are:
|a||Clear all breakpoints (|
|b||Set breakpoint, C-u b for a conditional break, C-n b for nth hit (|
|d||Clear current breakpoint (|
|e||Prompt for expression to print (|
|h||Continue to the line at cursor position (|
|i||Set breakpoint in module named here (|
|[||Go to the previous breakpoint in the file (|
|]||Go to the next breakpoint in the file
|\||Disable/Enable current breakpoint (|
|j||Set breakpoint at beginning of enclosing routine (|
|k||Skip one statement (|
|m||Continue to end of function (|
|n||Step, over function calls (|
|o||Continue past end of function (|
|p||Print expression near point or in region with C-u p (|
|q||End the debugging session and return to the Shell's main level
|r||Continue execution to next breakpoint, if any (|
|s or <SPACE>||Step, into function calls (|
|t||Print a calling-level traceback in the shell
|u||Continue to end of block (|
|v||Turn Electric Debug Mode off
|x||Examine expression near point (or in region with C-u x)
with shortcut of examine type.
|z||Reset IDL (|
|+ or =||Show higher level in calling stack (|
|- or _||Show lower level in calling stack (|
|?||Help on expression near point or in region with C-u ?
|C-?||Show help on the commands available.
Most single-character electric debug bindings use the final keystroke of the equivalent multiple key commands (which are of course also still available), but some differ (e.g., e,t,q,x). Some have additional convenience bindings (like <SPACE> for stepping). All prefix and other argument options described in this section for the commands invoked by electric debug bindings are still valid. For example, C-u b sets a conditional breakpoint, just as it did with C-u C-c C-d C-b.
You can toggle the electric debug mode at any time in a buffer using C-c C-d C-v (v to turn it off while in the mode), or from the Debug menu. Normally the mode will be enabled and disabled at the appropriate times, but occasionally you might want to edit a file while still debugging it, or switch to the mode for conveniently setting lots of breakpoints.
To quickly abandon a debugging session and return to normal editing at
the Shell's main level, use q (
This disables electric debug mode in all IDLWAVE buffers1. Help is
available for the command shortcuts with C-?. If you find this
mode gets in your way, you can keep it from automatically activating
by setting the variable
'breakpoint. If you'd like the convenient
electric debug shortcuts available also when run-time errors are
encountered, set to
Whether to enter electric debug mode automatically when a breakpoint or run-time error is encountered, and then disable it in all buffers when the $MAIN$ level is reached (either through normal program execution, or retall). In addition to
nilfor never, and
tfor both breakpoints and errors, this can be
'breakpoint(the default) to enable it only at breakpoint halts.
Default color of the stopped line overlay when in electric debug mode.
The face to use for the stopped line. Defaults to a face similar to the modeline, with color
If set, when entering electric debug mode, select the window displaying the file where point is stopped. This takes point away from the shell window, but is useful for immediate stepping, etc.
that this binding is not symmetric: C-c C-d C-q is bound to
idlwave-shell-quit, which quits your IDL session.