Flow Control

Index of All Documentation » Wing Pro Reference Manual » Debugger »

Once the debugger is running, the following commands are available for controlling further execution of the debug program from Wing. These are accessible from the tool bar and the Debug menu:

  • At any time, a freely running debug program can be paused with the Pause item in the Debug menu or with the pause tool bar button. This will stop at the current point of execution of the debug program.
  • At any time during a debug session, the Stop Debugging menu item or toolbar item can be used to force termination of the debug program. This option is disabled by default if the current process was launched outside of Wing. It may be enabled for all local processes by using the Kill Externally Launched preference.

When stopped on a given line of code, execution can be controlled as follows from the Debug menu (some of these are omitted in Wing Personal and Wing 101)

Step Over Instruction will step over a single instruction in Python. This may not leave the current line if it contains something like a list comprehension or single-line for loop.

Step Over Statement will step over the current statement, even if if spans more than one line or contains a looping construct like a list comprehension.

Step Over Block will step over or finish the current block of code, such as a for loop, conditional, function, or method.

Step Into will attempt to step into the next executed function on the current line of code. If there is no function or method to step into, this command acts like Step Over Instruction.

Step Out will complete execution of the current function or method and stop on the first instruction encountered after returning from the current function or method.

Continue will continue execution until the next breakpoint, exception, or program termination

Run To Cursor will run to the location of the cursor in the frontmost editor, or to the next breakpoint, exception, or program termination.

You can you also step through code using the toolbar icons. The step icon in the toolbar implements Step Over Statement.

Move Program Counter Here in the editor context menu (right-click) can be used to move the current position within the innermost stack frame in the debug process to any other valid position within the same scope. Stepping or execution will then continue with the selected line.

Attach and Detach (Wing Pro only) may be used to change the debugger between different debug processes. This is for advanced users and is detailed in Attaching and Detaching.