image

Call Stack

image

When a script is paused while debugging, the nest of handler calls currently being executed is displayed in the script window. This is the call stack (or call chain).

Execution typically starts with the script’s run handler (implicit or explicit). Code in this handler can call another handler, which can call another handler (or the same handler, recursively), and so on. Thus, at any given moment during the execution of your code, there is a nest or chain of handlers leading down from top level to the line currently being executed.

The call stack is displayed in a script window in debug mode in the same tab as the result pane and the variables pane. To see the call stack:

image

Each entry in the call stack is a stack frame. The stack frames are displayed from innermost (the most recent handler call) to outermost (the oldest handler call, usually the script’s run handler). Stack frames newly added since the last time the script paused are shown in red.

When multiple stack frames exist, the script can, in a sense, be paused at more than one line simultaneously. Therefore, the script is displayed with multiple green arrows. The line where we are really paused (within the deepest stack frame) has a solid green arrow; the others have transparent green arrows.

A stack frame, and the place where the script is paused within it, represent an entire environment. One stack frame is always the selected stack frame; by default, it is the deepest stack frame. The environment reflected in the script window changes when a different stack frame is selected. When you select a stack frame:



image
Trace Variables (Debug Mode)
image