5.4.3 Breakpoints and Stepping

IDLWAVE helps you set breakpoints and step through code. Setting a
breakpoint in the current line of the source buffer is accomplished
with C-c C-d C-b (idlwave-shell-break-here). With a
prefix arg of 1 (i.e., C-1 C-c C-d C-b), the breakpoint gets a
/ONCE keyword, meaning that it will be deleted after first use.
With a numeric prefix greater than one (e.g., C-4 C-c C-d C-b),
the breakpoint will only be active the nth time it is hit.
With a single non-numeric prefix (i.e., C-u C-c C-d C-b), prompt
for a condition: an IDL expression to be evaluated and trigger the
breakpoint only if true. To clear the breakpoint in the current line,
use C-c C-d C-d (idlwave-clear-current-bp). When
executed from the shell window, the breakpoint where IDL is currently
stopped will be deleted. To clear all breakpoints, use C-c C-d
C-a (idlwave-clear-all-bp). Breakpoints can also be disabled
and re-enabled: C-c C-d C-\
(idlwave-shell-toggle-enable-current-bp).

Breakpoint lines are highlighted or indicated with an icon in the source
code (different icons for conditional, after, and other break types).
Disabled breakpoints are grayed out by default. Note that IDL
places breakpoints as close as possible on or after the line you
specify. IDLWAVE queries the shell for the actual breakpoint location
which was set, so the exact line you specify may not be marked. You can
re-sync the breakpoint list and update the display at any time (e.g., if
you add or remove some on the command line) using C-c C-d C-l.

In recent IDLWAVE versions, the breakpoint line is highlighted when the
mouse is moved over it, and a tooltip pops up describing the break
details. mouse-3 on the breakpoint line pops up a menu of
breakpoint actions, including clearing, disabling, and adding or
changing break conditions or “after” break count.

Once the program has stopped somewhere, you can step through it. The
most important stepping commands are C-c C-d C-s to execute one
line of IDL code ("step into"); C-c C-d C-n to step a single line,
treating procedure and function calls as a single step ("step over");
C-c C-d C-h to continue execution to the line at the cursor and
C-c C-d C-r to continue execution. See Commands Sent to the Shell, for information on displaying or hiding the breakpoint and
stepping commands the shell receives. Here is a summary of the
breakpoint and stepping commands:

All of these commands have equivalents in Electric Debug Mode, which
provides faster single-key access (see Electric Debug Mode).

The line where IDL is currently stopped, at breakpoints, halts, and
errors, etc., is marked with a color overlay or arrow, depending on the
setting in idlwave-shell-mark-stop-line. If an overlay face is
used to mark the stop line (as it is by default), when stepping through
code, the face color is temporarily changed to gray, until IDL completes
the next command and moves to the new line.