<type>documentation</type>
<domain>debug</domain>
<id>debug-console-debugging</id>
<title>Debugging Code Recursively</title>
<date>$Date: 2006-12-28 17:21:05 -0500 (Thu, 28 Dec 2006) $</date>
<version>$Revision: 14455 $</version>
<product>pro+</product>
<product-version>6+</product-version>

Code executed in the ``Debug Console`` is run without debug by default, and any exceptions
are simply printed to the tool's console. Wing can also debug code recursively, so that
any breakpoints or exceptions reached from the ``Debug Console`` are reported in the
debugger. This is enabled by clicking on the bug icon in the upper right of the tool, or
by using the ``Enable Debugging`` item in the ``Options`` menu.

Debugging code from the ``Debug Console`` works the same way as described in `Debugging Code
in the Python Shell <ref:debug/shell-debugging>`__.

To interact with recursively debugged code, while the ``Debug Console`` prompt is 
busy, you can add additional ``Debug Console`` instances to the user interface by 
right clicking on tool tabs.  Or, turn on ``Enable Recursive Prompt`` in the
``Options`` menu so a new prompt is shown whenever the debugger is paused or
at a breakpoint, even if the ``Debug Console``'s earlier prompt is still in the
process of executing code.

As in the ``Python Shell``, ``Stop Debugging`` and ``Start/Continue`` will return to the
innermost prompt frame. ``Stop Debugging`` does this without debug but does not
preemptively interrupt the current invocation. In cases where this is a problem, the debug
process should be restarted instead.
