A stack frame is the area of the stack associated to each function call. It lists all functions and their arguments in the sequence they were called. Each stack frame is numbered starting from 0 for the current function. You can only view the stack frames while the debugger is running.
Moreover, a program can be composed of several threads. Each thread is executed independently and has its own registers, stack and local variables, but shares all global variables.
From the main menu, select View ▸ Stack to open the Stack window.
The stacks are displayed in a tree view having their corresponding thread as parent and displaying the following information:
This contains a yellow arrow to represent the active stack frame. By default it is frame 0, the current function. All evaluations and local variables are relative to this active frame. You can change the active stack frame to examine local variables in other functions.
This is a number corresponding to each thread.
This is the frame number starting from 0 for the current function. The first function of your program, for example main() in a C program, has the highest number.
The name of the file containing the function corresponding to this frame.
The line number of the function corresponding to this frame.
The name of the function corresponding to this frame.
The address of the function corresponding to this frame.
The function arguments.
In the Stack window, select the frame you want.
Right-click and select Set current frame.
Clicking on a stack frame in the same thread changes only the stack frame, allowing to see other local variables. But doing it in another thread will change both the stack frame and the thread. The register values will be different and the debugger will restart in the selected thread.
In the Stack window, select the frame you want.
Double-click, or right-click and select View Source.
In the Stack window, right-click and select Get stack trace.
Got a comment? Spotted an error? Found the instructions unclear? Send feedback about this page.