Using the Call Stack Window
Using the Call Stack window, you can view the function or procedure calls that are currently on the stack.
To display the Call Stack window
- From the Debug menu, choose Windows and click Call Stack. (The debugger must be running or in break mode.)
The Call Stack window displays the name of each function and the programming language it is written in. The function or procedure name may be accompanied by optional information, such as module name, line number, byte offset, and parameter names, types, and values. The display of this optional information can be turned on or off.
To change the optional information displayed
- Right-click the Call Stack window and set or clear Show <the desired information> from the shortcut menu.
In managed applications, call stack information for non-user code (code for which no symbols are available, regardless of who wrote it) is hidden by default. When non-user code information is hidden, the call stack display will show the following annotation in place of the call stack information:
If you want to display the call stack information for non-user code, use the shortcut menu:
To display non-user code frames in the Call Stack window
- Right-click the Call Stack window and choose Show Non-user Code from the shortcut menu.
In the Call Stack window, a yellow arrow identifies the stack frame where the execution pointer is currently located. By default, this is the frame whose source appears in the source and Disassembly windows and whose local variables appear in the Locals, Watch, and Autos windows. If you want to view the code and variables for another frame, you can switch to that frame in the Call Stack window.
To switch to another stack frame
- In the Call Stack window, right-click on the frame whose code and data you want to view.
- From the shortcut menu, select Switch to Frame.
A green triangle appears next to the frame you selected. The execution pointer remains in the original frame, which is still marked with the yellow arrow. If you select Step or Continue from the Debug menu, execution will continue in the original frame, not the frame you selected.
By default, the Call Stack window does not display calls to or from another thread. If you want to see those calls, follow this procedure.
To display calls to or from another thread
- Right-click the Call Stack window and choose Include Calls To/From Other Threads from the shortcut menu.
In addition, you can use the shortcut menu to quickly view the source or disassembly code for a function that appears on the call stack.
To view the source code for a function on the call stack
- In the Call Stack window, right-click the function whose source code you want to see and choose Go To Source Code from the shortcut menu.
To view the disassembly code for a function on the call stack
- In the Call Stack window, right-click the function whose disassembly code you want to see and choose Go To Disassembly from the shortcut menu.
Using the Call Stack window, you can run to a specific function or set a breakpoint on the exit point of a function call. For more information, see Running to a Specified Function and Breakpoint Operations in the Call Stack Window.
You can reload symbols for a module using the Call Stack window.
To reload symbols for a module
- In the Call Stack window, right-click the frame showing the module whose symbols you want to reload and choose Reload Symbols from the shortcut menu.
Call Stack Window | Mixed Code and Missing Information in the Call Stack Window | Changing the Numeric Format of Source Windows | Debugging Tools for Inspecting Your Program | Visual Studio Debugger Model