Debugger
Wing Pro's debugger provides a powerful toolset for rapidly locating and fixing bugs in single and multi-threaded Python code, and in a single or multi-processing environment. The debugger supports breakpoints, stepping through code, inspecting and changing stack or module data, watch points, expression evaluation, and command shell style interaction with the paused debug process.
There are a number of ways to use Wing's debugger. Which you use depends on where your code is running, and how it is invoked:
Local Stand-Alone Code -- Wing can debug stand-alone scripts and applications that run on your local machine and that are launched on demand from within Wing. For details, see Debugger Quick-Start.
Remote Stand-Alone Code -- Wing Pro can debug stand-alone code remotely in the same way as it debugs locally running code. This is done by configuring a remote host to which Wing will connect via SSH tunnel. For details on this, see Remote Hosts.
Local Embedded or Externally Launched Code -- Wing can also debug code that runs within a web server, in an embedded Python instance (for example as a script that controls a larger application), and other code that cannot be directly launched from the IDE. For details, see Debugging Externally Launched Code.
Remote Embedded or Externally Launched Code -- Finally, Wing Pro can debug externally launched or embedded code that is running on another host. For details, see Debugging Externally Launched Remote Code.
Because the debugger core is written in optimized C, debug overhead is relatively low. However, you should expect your programs to run 25-50% slower within the debugger in most code. Overhead is proportional to number of Python byte codes executed, so code that does a lot of work in Python and very little in support libraries will incur more overhead.
Wing Personal and Wing 101 omit some of the above features.
Section Contents
13.1. Debug Environment
13.2. Named Entry Points
13.3. Specifying Main Entry Point
13.4. Setting Breakpoints
13.5. Starting Debug
13.6. Debugger Status
13.7. Flow Control
13.8. Viewing the Stack
13.9. Viewing Debug Data
13.9.0. Stack Data Tool
13.9.0.0. Array, Data Frame, and Textual Data Views
13.9.0.1. Stack Data Options Menu
13.9.0.2. Stack Data Context Menu
13.9.0.3. Filtering Value Display
13.9.0.4. Advanced Data Display
13.9.1. Viewing Data on the Editor
13.9.2. Watching Values
13.9.3. Evaluating Expressions
13.9.4. Problems Handling Values
13.10. Debug Process I/O
13.10.0. External I/O Consoles
13.10.1. Debug Process I/O Multiplexing
13.11. Interactive Debug Console
13.11.0. Managing Program State
13.11.1. Debugging Code Recursively
13.11.2. Debug Console Options
13.11.3. Debug Console Limitations
13.12. Multi-Process Debugging
13.12.0. Debugging Child Processes
13.12.1. Process Control
13.13. Debugging Multi-threaded Code
13.14. Managing Exceptions
13.15. Running Without Debug