How to: Specify Symbol Locations and Loading Behavior
This topic applies to:
Edition |
Visual Basic |
C# |
F# |
C++ |
Web Developer |
---|---|---|---|---|---|
Express |
|||||
Pro, Premium, and Ultimate |
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
On the Tools menu, choose Options.
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.
Click the folder icon.
Editable text appears in the Symbol file (.pdb) locations box.
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.
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.
Click OK.
To remove a pathname from the symbols path list
Open the Options dialog box and locate the Symbols page, as described in the previous procedure.
Select a path in the Symbol file (.pdb) locations box.
Click the red X icon.
Click OK.
To specify symbols to be loaded automatically
Open the Options dialog box and locate the Symbols page, as described in the previous procedure.
Under Automatically load symbols for, click All modules, unless excluded or Only specified modules.
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.
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.
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
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.
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
Program Database Files (C#, F#, and Visual Basic)
Installing Symbols for Debugging System Call Crashes