You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md
+79-15Lines changed: 79 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,8 +87,8 @@ The debugger searches for symbol files in the following locations:
87
87
88
88
**Third-party symbol servers**: Third-party providers of Windows applications and libraries can provide access to symbol server on the internet.
89
89
90
-
> [!WARNING]
91
-
> If you use a symbol server other than the public Microsoft Symbol Servers, make sure that the symbol server and its path are trustworthy. Because symbol files can contain arbitrary executable code, you can be exposed to security threats.
90
+
> [!WARNING]
91
+
> If you use a symbol server other than the public Microsoft Symbol Servers, make sure that the symbol server and its path are trustworthy. Because symbol files can contain arbitrary executable code, you can be exposed to security threats.
92
92
93
93
## Configure location of symbol files and loading options
94
94
@@ -103,6 +103,11 @@ On the **Tools** > **Options** > **Debugging** > **Symbols** page, you can:
103
103
104
104
**To specify symbol locations and loading options:**
105
105
106
+
::: moniker range="= vs-2022"
107
+
> [!NOTE]
108
+
> These options were updated in Visual Studio 2022 Version 17.12 Preview 1.
109
+
::: moniker-end
110
+
106
111
1. In Visual Studio, open **Tools** > **Options** > **Debugging** > **Symbols** (or **Debug** > **Options** > **Symbols**).
107
112
108
113
2. Under **Symbol file (.pdb) locations**,
@@ -112,15 +117,15 @@ On the **Tools** > **Options** > **Debugging** > **Symbols** page, you can:
112
117
1. Select the **+** symbol in the toolbar.
113
118
1. Type the URL (http), network share, or local path of the symbol server or symbol location in the text field. Statement completion helps you find the correct format.
>Only the specified folder is searched. You must add entries for any subfolders that you want to search.
127
+
> [!NOTE]
128
+
> Only the specified folder is searched. You must add entries for any subfolders that you want to search.
124
129
125
130
- To add a new Azure DevOps Symbol Server location:
126
131
@@ -135,20 +140,79 @@ On the **Tools** > **Options** > **Debugging** > **Symbols** page, you can:
135
140
136
141
3. (Optional) To improve symbol loading performance, under **Cache symbols in this directory**, type a local folder path that symbol servers can copy symbols to.
137
142
138
-
> [!NOTE]
139
-
> Do not place the local symbol cache in a protected folder, like C:\Windows or a subfolder. Use a read-write folder instead.
143
+
> [!NOTE]
144
+
> Do not place the local symbol cache in a protected folder, like C:\Windows or a subfolder. Use a read-write folder instead.
140
145
141
-
> [!NOTE]
142
-
> For C++ projects, if you have the `_NT_SYMBOL_PATH` environment variable set, it will override the value set under **Cache symbols in this directory**.
146
+
> [!NOTE]
147
+
> If you have the `_NT_SYMBOL_PATH` environment variable set, it overrides the value set under **Cache symbols in this directory**.
143
148
144
149
4. Specify the modules that you want the debugger to load from the **Symbol file (.pdb) locations** when it starts.
145
150
151
+
::: moniker range=">= vs-2022"
152
+
153
+
- Select **Automatically choose what module symbols to search for** (recommended) to allow
154
+
Visual studio to decide what symbols to search for and load. By default, Visual Studio
155
+
automatically loads symbols that were built by your opened solution, and loads any
156
+
additional symbols that are needed to perform common debugging operations. This reduces
157
+
the number of files that must be searched for and loaded by Visual Studio, which
158
+
improves debugger performance. You can force additional symbols to load by clicking the
159
+
**Specify module filters** link.
160
+
161
+
- Select **Search for all module symbols unless excluded** to force Visual Studio to
162
+
load all symbols in your debugged process. This is not recommended because it may
163
+
slow down your debugging experience. If you select this option, you can force
164
+
Visual Studio to ignore certain symbols by clicking the **Specify module filters**
165
+
link.
166
+
167
+
::: moniker-end
168
+
::: moniker range="<= vs-2019"
169
+
146
170
- Select **Load all modules, unless excluded** (the default) to load all the symbols for all modules in the symbol file location, except modules you specifically exclude. To exclude certain modules, select **Specify excluded modules**, select the **+** icon, type the names of the modules to exclude, and select **OK**.
147
171
148
172
- To load only modules you specify from the symbol file locations, select **Load only specified modules**. Select **Specify included modules**, select the **+** icon, type the names of the modules to include, and then select **OK**. The symbol files for other modules are not loaded.
173
+
::: moniker-end
149
174
150
175
5. Select **OK**.
151
176
177
+
::: moniker range=">= vs-2022"
178
+
179
+
### Specify module filters
180
+
Both the **Automatically choose what module symbols to search for** and **Search for all
181
+
module symbols unless excluded** options allow you to have more fine control over what symbols
182
+
are searched for while debugging. Choose **Specify module filters** to fine-tune your experience.
183
+
184
+
By default, you see the following dialog when **Automatically choose what module symbols to search for** is selected:
185
+
186
+

187
+
188
+
You can add a module to the filter by using the '+' icon. Module filters support simple wild-card
189
+
matching. A '\*' matches any group of characters. For example '\*myproduct\*' will match files such
190
+
as 'myproduct.utilities.dll' and 'entrypoint.myproduct.exe', among others.
191
+
192
+
There are several additional options to further customize your experience:
193
+
194
+
-**Always load symbols located next to modules** instructs visual studio to load pdb files that
195
+
are stored in the file system beside their corresponding .dll or .exe files. This can be helpful,
196
+
for example, when attempting to debug a deployed web app.
197
+
198
+
-**Automatically load additional symbols when needed** instructs Visual Studio to search for
199
+
symbols to perform common debug actions, such as stepping, even if the module that you will be
200
+
stepping to is not in your project or in the modules filter. The way that searching is determined
201
+
might be affected by your [Just My Code](just-my-code.md) settings.
202
+
203
+
If you have selected **Search for all module symbols unless excluded**, then the module filter
204
+
dialog looks like this:
205
+
206
+

207
+
208
+
In this dialog, you can choose what modules you *do not* want Visual Studio to load symbols for.
209
+
In this scenario, Visual Studio attempts to load symbols for every module in your debugged
210
+
proces (including modules by third parties), unless you add a matching filter to exclude them.
211
+
The only other way that this behavior will be modified is by your [Just My Code](just-my-code.md)
212
+
settings.
213
+
214
+
::: moniker-end
215
+
152
216
## Other symbol options for debugging
153
217
154
218
You can select additional symbol options in **Tools** > **Options** > **Debugging** > **General** (or **Debug** > **Options** > **General**):
@@ -169,10 +233,10 @@ You can select additional symbol options in **Tools** > **Options** > **Debuggin
169
233
170
234
You can limit the commands that *srcsrv.dll* can execute from the app's *.pdb* file by listing the allowed commands in a file named *srcsrv.ini*. Place the *srcsrv.ini* file in the same folder as *srcsrv.dll* and *devenv.exe*.
171
235
172
-
>[!IMPORTANT]
173
-
>Arbitrary commands can be embedded in an app's *.pdb* file, so make sure to put only the commands you want to execute into a *srcsrv.ini* file. Any attempt to execute a command not in the *srcsvr.ini* file will cause a confirmation dialog box to appear. For more information, see [Security Warning: Debugger Must Execute Untrusted Command](../debugger/security-warning-debugger-must-execute-untrusted-command.md).
236
+
>[!IMPORTANT]
237
+
>Arbitrary commands can be embedded in an app's *.pdb* file, so make sure to put only the commands you want to execute into a *srcsrv.ini* file. Any attempt to execute a command not in the *srcsvr.ini* file will cause a confirmation dialog box to appear. For more information, see [Security Warning: Debugger Must Execute Untrusted Command](../debugger/security-warning-debugger-must-execute-untrusted-command.md).
174
238
>
175
-
>No validation is done on command parameters, so be careful with trusted commands. For example, if you listed *cmd.exe* in your *srcsrv.ini*, a malicious user might specify parameters on *cmd.exe* that would make it dangerous.
239
+
>No validation is performed on command parameters, so be careful with trusted commands. For example, if you listed *cmd.exe* in your *srcsrv.ini*, a malicious user might specify parameters on *cmd.exe* that would make it dangerous.
176
240
177
241
Select this item and the child items you want. **Allow source server for partial trust assemblies (Managed only)** and **Always run untrusted source server commands without prompting** can increase the security risks.
0 commit comments