Partilhar via


How to: Use the Call Stack Window 

This topic applies to:

Visual Studio Edition

Visual Basic

C#

C++

J#

Web Dev

Express Edition

No

Yes

Yes

Yes

Yes

Standard Edition

Yes

Yes

Yes

Yes

Yes

Pro/Team Edition

Yes

Yes

Yes

Yes

Yes

Using the Call Stack window, you can view the function or procedure calls that are currently on the stack.

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.

A yellow arrow identifies the stack frame where the execution pointer is currently located. By default, this is the frame whose information appears in the source, Disassembly, Locals, Watch, and Autos windows. If you want to change the context to another frame on the stack, you can do that in , the Call Stack window.

When debugging symbols are not available for part of a call stack, the Call Stack window may not be able to display correct information for that part of call stack. The following notation appears:

[Frames below may be incorrect and/or missing, no symbols loaded for name.dll]

In managed code, the Call Stack window hides information for non-user code by default. The following notation appears in place of the hidden information:

[<External Code>]

Non-user code is any code that is not "My Code." For more information on "My Code," see How to: Step Into Just My Code. You can choose to display the call stack information for non-user code using the shortcut menu.

By default, the Call Stack window does not display calls to or from another thread. You can choose to see those calls, using the shortcut menu.

NoteNote

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To display the Call Stack window (in break mode or run mode)

  • From the Debug menu, choose Windows and click Call Stack.

To change the optional information displayed

  • Right-click the Call Stack window and set or clear Show <the desired information> from the shortcut menu.

To display non-user code frames in the Call Stack window

  • Right-click the Call Stack window and choose Show External Code from the shortcut menu.

To switch to another stack frame

  1. In the Call Stack window, right-click on the frame whose code and data you want to view.

  2. From the shortcut menu, select Switch to Frame.

    A green arrow with a curly tail 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.

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.

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.

To run to a specific function from the Call Stack window

To set a breakpoint on the exit point of a function call

To load symbols for a module

  • In the Call Stack window, right-click the frame showing the module whose symbols you want to reload and choose Load Symbols from the shortcut menu.

See Also

Reference

How to: Change the Numeric Format of Debugger Windows

Concepts

Mixed Code and Missing Information in the Call Stack Window
Viewing Data in the Debugger