<type>documentation</type>
<domain>debug</domain>
<id>starting-debug</id>
<title>Starting Debug</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>all</product>

~~~if not WEBSITE:
The following items in the ``Debug`` menu, or their key bindings, can be used to start
debugging:
~~~
~~~if WEBSITE:
The following items in the ``Debug`` menu, or their can bindings, can be used to start
debugging. Some of these are omitted in Wing Personal and Wing 101:
~~~

~~~if not WING101:
* ``Start / Continue`` runs the main entry point, if one has been set as described in
  `Specifying Main Entry Point <ref:debug/main-entry-point>`__, or otherwise the
  file open in the current editor. Execution stops at the first breakpoint or exception, or
  upon program completion.
~~~

~~~if WING101:
* ``Start / Continue`` runs the file from the current editor. Execution stops at the first
  breakpoint or exception, or upon program completion.
~~~

* ``Step Into`` starts a debug session that stops at the first line of code.

~~~if not WING101:
* ``Debug Current File`` runs the file from the current editor. This will stop on the first
  breakpoint or exception, or upon program completion.

* ``Run to Cursor`` starts or continues debugging until it reaches the line selected in
  the current editor, until a breakpoint or exception is encountered, or until program
  completion.

* ``Debug Recent`` can be used to rerun a recent debug session. This will stop on the
  first breakpoint or exception, or upon program completion.
~~~

Other ways to start debug include:

~~~if not WING101:
* ``Debug Selected`` in the right-click context menu on the ``Project`` tool runs the
  selected file.  
~~~

~~~if WINGPRO:
* In Wing Pro, `Named Entry Points <ref:debug/named-entry-points>`__ can be used from 
  the ``Debug`` menu, to debug or execute files in a particular environment.
~~~

* Code may also be debugged from the ``Python Shell`` tool by clicking on the bug
  icon in the top right of the tool and entering some code or using the ``Evaluate``
  options in the ``Source`` menu.  See `Debugging Code in the Python Shell 
  <ref:debug/shell-debugging>`__ for details.
  
~~~if not WING101:
* In Wing Pro and Wing Personal, debug may also be initiated from outside of Wing. See
  `Debugging Externally Launched Code <ref:debug/debugging-externally-launched-code>`__ for
  details.
~~~

Once a debug process has been started, the status indicator in the lower left of
the window should change from white or grey to another color, as described
in `Debugger Status <ref:debug/status>`__.

Note that when debugging code from the ``Python Shell`` the debugger only appears active
if code is actually running and the shell is not at the prompt.

~~~if WINGPRO:
**Custom Python Compilations**

Wing's debugger contains an extension module that uses the cross-Python API to support
multiple versions of Python with a single compilation of the module. This should cover
most custom compilations of Python. However, if you need to support a new OS or device, or
an unusual compile configuration, you may need to recompile the debugger core to match
your compilation of Python. This is possible for Wing Pro users, through access to the
source code under NDA. Please `contact us <mailto:support@wingware.com>`__ for details.
~~~

