How to: Use the Call Stack Window

This topic applies to:

Edition

Visual Basic

C#

C++

Web Developer

Express

Topic applies Topic applies

Topic applies

Topic applies

Standard

Topic applies

Topic applies

Topic applies

Topic applies

Pro and Team

Topic applies

Topic applies

Topic applies

Topic applies

Table legend:

Topic applies

Applies

Topic does not apply

Does not apply

Topic applies but command hidden by default

Command or commands hidden by default.

By 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 might 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 instead of the hidden information:

[<External Code>]

Non-user code is any code that is not "My Code." For more information about "My Code," see How to: Step Into Just My Code. You can choose to display the call stack information for non-user code by 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 by using the shortcut menu.

Note

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 in run mode

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

To change the optional information displayed

  • Right-click the Call Stack window and set or clear Show <the information that you want>.

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

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

To switch to another stack frame

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

  2. 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.

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.

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.

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 that shows the module whose symbols you want to reload and choose Load Symbols.

Loading Symbols

In the Call Stack window, you can load debugging symbols for code that does not currently have symbols loaded. These symbols can be .NET Framework or system symbols downloaded the Microsoft public symbol servers or symbols in a symbol path on the computer that you are debugging.

For more information, see How to: Use a Symbol Server and How to: Specify a Symbol Path,

To load symbols

  1. In the Call Stack window, right-click frame for which symbols are not loaded. The frame will be dimmed.

  2. Point to Load Symbols From and then click Microsoft Symbol Servers or Symbol Path.

To set the symbol path

  1. In the Modules window, right-click any module.

  2. Click Symbol Settings.

    The Options dialog box opens and the Symbols page is displayed.

  3. In the Options dialog box, click the Folder icon.

    In the Symbol file (.pdb) locations box, a cursor appears.

  4. Type a directory pathname to the symbol location on the computer that you are debugging. For local debugging, this is your local computer. For remote debugging, it is the remote computer.

  5. Click OK to close the Options dialog box.

See Also

Tasks

How to: Use a Symbol Server

How to: Specify a Symbol Path

Concepts

Mixed Code and Missing Information in the Call Stack Window

Viewing Data in the Debugger

Reference

How to: Change the Numeric Format of Debugger Windows