Viewing the Stack

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


Whenever the debug program is paused at a breakpoint, at an exception, or during stepping, the current stack is displayed in the Call Stack tool. This shows all program stack frames encountered between invocation of the program and the current run position. Outermost stack frames are higher up on the list. If there are PEP 3134 chained exceptions, these are listed in the order that they occurred, above the final exception.

When the debugger steps or stops at a breakpoint or exception, it selects the innermost stack frame by default. In order to visit other stack frames further up or down the stack, select them in the Call Stack tool.

You may also change stack frames using the Up Stack and Down Stack items in the Debug menu, the up/down stack icons in the toolbar, the toolbar stack popup menu, and the stack selector popup menus at the top of other debugging tools. Show Original Position can be used to jump back to the thread and stack position where the debugger originally stopped.

In Wing Pro and Personal, Visit Inner Project Frames toggles between the innermost stack frame in the current thread, the innermost frame that belongs to a file that's been added to the Project tool, and the innermost frame that is in a unit test in the Testing tool (if any). This makes it easier to jump between the actual exception that occurred and the places most likely to require a bug fix.

You can also move around the stack with the stack frame items in the toolbar or in the top right of the Exceptions tool.

When you change stack frames, all the tools in Wing that reference the current stack frame will be updated, and the current line of code at that stack frame is shown in the editor.

In Wing Pro, the current stack frame is also used to control evaluation context in the Debug Console and Watch tools.

To change the type of stack display, right-click on the Call Stack tool.

When an exception has occurred, a backtrace is also captured by the Exceptions tool, where it can be accessed even after the debug process has exited.