Share via


How to: Specify Symbol Locations and Loading Behavior

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

Topic applies Topic applies Topic applies Topic applies Topic applies

Pro, Premium, and Ultimate

Topic applies Topic applies Topic applies Topic applies Topic applies

To debug your application, the debugger requires symbol information that is stored in PDB files. In some cases, the symbol information might be in older format DBG files. Symbol files are required for your application and for any third-party or system DLLs you have to have to debug. Symbol files can be stored in a directory on your computer or downloaded from a symbol server.

By default, the debugger loads symbol files from the location where your EXE is located. To use symbols from another directory or a symbol server, you must specify the locations to Visual Studio.

Visual Studio loads symbols automatically when you begin a debug session. You can specify which modules Visual Studio loads symbols for automatically. If you choose not to load symbols for all your modules automatically, you can load additional symbols manually by using the Modules window.

For information about how to use symbol servers, see How to: Use a Symbol Server. If you use a symbol server, make sure that the server is trustworthy. Otherwise, you might be exposed to security threats.

To specify a directory where symbol files are located

  1. On the Tools menu, choose Options.

  2. In the Options dialog box, open the Debugging node and then click Symbols.

    On the Symbols page, there is a box that states Symbol file (.pdb) locations. Above the box are four icons.

  3. Click the folder icon.

    Editable text appears in the Symbol file (.pdb) locations box.

  4. Type the directory path. Statement completion helps you find the correct format.

    If you are doing remote debugging, symbol files and symbol server caches for managed code must be located on the remote computer. Symbol files and symbol server caches for native code must be located on the local computer.

  5. If you are using symbols on a remote symbol server, you can improve performance by specifying a local directory that symbols can be copied to. To do this, type a path in the Cache symbols in this directory box. If you are debugging a program on a remote computer, the cache directory refers to the directory on the remote computer.

  6. Click OK.

To remove a pathname from the symbols path list

  1. Open the Options dialog box and locate the Symbols page, as described in the previous procedure.

  2. Select a path in the Symbol file (.pdb) locations box.

  3. Click the red X icon.

  4. Click OK.

To specify symbols to be loaded automatically

  1. Open the Options dialog box and locate the Symbols page, as described in the previous procedure.

  2. Under Automatically load symbols for, click All modules, unless excluded or Only specified modules.

  3. If you chose All modules, unless excluded, you can now click Specify excluded modules.

    The Symbol to exclude from automatic loading dialog box appears.

    Click the document icon to add a module to the Modules list, or select a module in the Modules list and click the X icon to remove it.

    When you are finished, click OK.

  4. If you chose Only specified modules, you can now click Specify modules.

    The Symbols to load automatically dialog box appears.

    Click the document icon to add a module to the Modules list, or select a module in the Modules list and click the X icon to remove it.

    By default, symbols located in the directories where your application modules are always loaded. To stop this default behavior, clear Always load symbols located next to modules.

    When you are finished, click OK.

  5. Click OK.

Loading Symbols Manually

You can load symbols manually from the Modules window. This feature is not available in the Visual Basic, Visual C#, or Web Developer Express Editions.

To load symbols manually

  1. Right-click in the Modules window, point to Load Symbols From, then click Symbol Path or Microsoft Symbol Servers.

    The debugger searches the symbol path or symbol servers to find the symbols. If the debugger does not find symbols, the Find Symbols dialog box appears.

  2. In the Find Symbols dialog box, locate the symbols file that you want to load, then click OK.

    The symbols file is either a .pdb file or a .dbg file.

See Also

Reference

Symbols, Debugging, Options Dialog Box

Concepts

DBG Files

Program Database Files (C++)

Program Database Files (C#, F#, and Visual Basic)

Installing Symbols for Debugging System Call Crashes

Other Resources

Debug Settings and Preparation