Skip to content

Commit 0fe334f

Browse files
authored
Merge pull request #9261 from Mikejo5000/mikejo-br16
SEO and edits for article on specifying symbol files in the debugger
2 parents ce8c3ca + 5ffd208 commit 0fe334f

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

docs/debugger/how-to-use-the-modules-window.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The **Symbol Status** column in the **Modules** window shows which modules have
5555

5656
1. If the symbols don't load, select **Symbol Settings** to open the **Options** dialog, and specify or change symbol loading locations.
5757

58-
You can download symbols from the public Microsoft Symbol Servers or other servers, or load symbols from a folder on your computer. For details, see [Specify symbol locations and loading behavior](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#BKMK_Specify_symbol_locations_and_loading_behavior).
58+
You can download symbols from the public Microsoft Symbol Servers or other servers, or load symbols from a folder on your computer. For details, see [Configure location of symbol files and loading behavior](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#configure-location-of-symbol-files-and-loading-options).
5959

6060
**To change symbol loading behavior settings:**
6161

docs/debugger/navigating-through-code-with-the-debugger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ To look at framework code, third-party library code, or system calls while debug
185185

186186
If you've loaded debugging symbols for Microsoft system code and disabled Just My Code, you can step into a system call just as you can any other call.
187187

188-
To learn about loading Microsoft symbols, see [Configure symbol locations and loading options](specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#configure-symbol-locations-and-loading-options).
188+
To learn about loading Microsoft symbols, see [Configure location of symbol files and loading options](specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md#configure-location-of-symbol-files-and-loading-options).
189189

190190
**To load symbols for a specific system component**
191191

docs/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ ms.workload:
3434

3535
Program database (*.pdb*) files, also called symbol files, map identifiers and statements in your project's source code to corresponding identifiers and instructions in compiled apps. These mapping files link the debugger to your source code, which enables debugging.
3636

37-
When you build a project from the Visual Studio IDE with the standard Debug build configuration, the compiler creates the appropriate symbol files. This article describes how to manage symbol files in the IDE, for example, how to [specify the location of symbols in the debugger options](#BKMK_Specify_symbol_locations_and_loading_behavior), how to [check symbol loading status](#work-with-symbols-in-the-modules-window) while debugging, and how to [set symbol options in code](#compiler-symbol-options).
37+
When you build a project from the Visual Studio IDE with the standard Debug build configuration, the compiler creates the appropriate symbol files. This article describes how to manage symbol files in the IDE, for example:
38+
39+
- [Configure the location of symbol files](#configure-location-of-symbol-files-and-loading-options)
40+
- [Load symbols while debugging](#load-symbols-while-debugging)
41+
- [Compiler options for symbols](#compiler-symbol-options).
3842

3943
For a detailed explanation of symbol files, see the following:
4044

4145
- [Understand symbol files and Visual Studio symbol settings](https://devblogs.microsoft.com/devops/understanding-symbol-files-and-visual-studios-symbol-settings/)
4246

43-
- [Why does Visual Studio require debugger symbol files to exactly match the binary files that they were built with?](/archive/blogs/jimgries/why-does-visual-studio-require-debugger-symbol-files-to-exactly-match-the-binary-files-that-they-were-built-with)
44-
4547
## How symbol files work
4648

4749
The *.pdb* file holds debugging and project state information that allows incremental linking of a Debug configuration of your app. The Visual Studio debugger uses *.pdb* files to determine two key pieces of information while debugging:
@@ -51,27 +53,29 @@ The *.pdb* file holds debugging and project state information that allows increm
5153

5254
Symbol files also show the location of the source files, and optionally, the server to retrieve them from.
5355

54-
The debugger only loads *.pdb* files that exactly match the *.pdb* files created when an app was built (that is, the original *.pdb* files or copies). This [exact duplication](/archive/blogs/jimgries/why-does-visual-studio-require-debugger-symbol-files-to-exactly-match-the-binary-files-that-they-were-built-with) is necessary because the layout of apps can change even if the code itself has not changed.
56+
The debugger only loads *.pdb* files that exactly match the *.pdb* files created when an app was built (that is, the original *.pdb* files or copies). This exact duplication is necessary because the layout of apps can change even if the code itself has not changed. For more information, see [Why does Visual Studio require debugger symbol files to exactly match the binary files that they were built with?](/archive/blogs/jimgries/why-does-visual-studio-require-debugger-symbol-files-to-exactly-match-the-binary-files-that-they-were-built-with)
5557

5658
> [!TIP]
5759
> To debug code outside your project source code, such as Windows code or third-party code your project calls, you must specify the location of the external code's *.pdb* files (and optionally, the source files), which must exactly match the builds in your app.
5860
59-
## Symbol file locations and loading behavior
61+
## Where the debugger looks for symbols
6062

61-
When you debug a project in the Visual Studio IDE, the debugger automatically loads symbol files that are located in the project folder.
63+
When you debug a project in the Visual Studio IDE, the debugger automatically loads symbol files that it can find by default.
6264

6365
> [!NOTE]
64-
> When debugging managed code on a remote device, all symbol files must be located either on the local machine, or in a location [specified in the debugger options](#BKMK_Specify_symbol_locations_and_loading_behavior).
66+
> When debugging managed code on a remote device, all symbol files must be located either on the local machine, or in a location [specified in the debugger options](#configure-location-of-symbol-files-and-loading-options).
67+
68+
The debugger searches for symbol files in the following locations:
6569

66-
The debugger also searches for symbol files in the following locations:
70+
1. The project folder.
6771

6872
1. The location that is specified inside the DLL or the executable (*.exe*) file.
6973

7074
By default, if you have built a DLL or an *.exe* file on your computer, the linker places the full path and filename of the associated *.pdb* file in the DLL or *.exe* file. The debugger checks to see if the symbol file exists in that location.
7175

72-
2. The same folder as the DLL or *.exe* file.
76+
1. The same folder as the DLL or *.exe* file.
7377

74-
3. Any locations specified in the debugger options for symbol files. To add and enable symbol locations, see [Configure symbol locations and loading options](#BKMK_Specify_symbol_locations_and_loading_behavior).
78+
1. Any locations specified in the debugger options for symbol files. To add and enable symbol locations, see [Configure symbol locations and loading options](#configure-location-of-symbol-files-and-loading-options).
7579

7680
- Any local symbol cache folder.
7781

@@ -88,14 +92,16 @@ The debugger also searches for symbol files in the following locations:
8892
> [!WARNING]
8993
> 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.
9094
91-
<a name="BKMK_Specify_symbol_locations_and_loading_behavior"></a>
92-
### Configure symbol locations and loading options
95+
## Configure location of symbol files and loading options
96+
97+
The debugger checks various locations for symbols by default. See [Where the debugger looks for symbols](#where-the-debugger-looks-for-symbols).
9398

9499
On the **Tools** > **Options** > **Debugging** > **Symbols** page, you can:
95100

96-
- Specify and select search paths and symbol servers for Microsoft, Windows, or third-party components.
101+
- Specify and select search paths for symbol files.
102+
- Specify symbol servers for Microsoft, Windows, or third-party components.
97103
- Specify modules that you do or don't want the debugger to automatically load symbols for.
98-
- Change these settings while you are actively debugging. See [Manage symbols while debugging](#manage-symbols-while-debugging).
104+
- Change these settings while you are actively debugging. See [Load symbols while debugging](#load-symbols-while-debugging).
99105

100106
**To specify symbol locations and loading options:**
101107

@@ -155,7 +161,7 @@ You can select additional symbol options in **Tools** > **Options** > **Debuggin
155161
Always shows the disassembly when source or symbol files are not found.
156162

157163
![Options &#47; Debugging &#47; General disassembly options](../debugger/media/dbg-options-general-disassembly-checkbox.png "Options &#47; Debugging &#47; General disassembly options")
158-
<a name="BKMK_Use_symbol_servers_to_find_symbol_files_not_on_your_local_machine"></a>
164+
159165
- **Enable source server support**
160166

161167
Uses Source Server to help debug an app when there is no source code on the local machine, or the *.pdb* file does not match the source code. Source Server takes requests for files and returns the actual files from source control. Source Server runs by using a DLL named *srcsrv.dll* to read the app's *.pdb* file. The *.pdb* file contains pointers to the source code repository, as well as commands used to retrieve source code from the repository.
@@ -175,6 +181,8 @@ You can select additional symbol options in **Tools** > **Options** > **Debuggin
175181

176182
When you build a project from the Visual Studio IDE with the standard **Debug** build configuration, the C++ and managed compilers create the appropriate symbol files for your code. You can also set compiler options in code.
177183

184+
To set the compiler options for your build configurations in Visual Studio, see [Set debug and release configurations](../debugger/how-to-set-debug-and-release-configurations.md).
185+
178186
### .NET options
179187

180188
Build with **/debug** to create a *.pdb* file. You can build applications with **/debug:full** or **/debug:pdbonly**. Building with **/debug:full** generates debuggable code. Building with **/debug:pdbonly** generates *.pdb* files, but does not generate the `DebuggableAttribute` that tells the JIT compiler that debug information is available. Use **/debug:pdbonly** if you want to generate *.pdb* files for a release build that you do not want to be debuggable. For more information, see [/debug (C# compiler options)](/dotnet/csharp/language-reference/compiler-options/debug-compiler-option) or [/debug (Visual Basic)](/dotnet/visual-basic/reference/command-line-compiler/debug).
@@ -207,7 +215,7 @@ Build with **/debug** to create a *.pdb* file. You can build applications with *
207215

208216
Set the *web.config* file of your ASP.NET application to debug mode. Debug mode causes ASP.NET to generate symbols for dynamically generated files and enables the debugger to attach to the ASP.NET application. Visual Studio sets this automatically when you start to debug, if you created your project from the web projects template.
209217

210-
## Manage symbols while debugging
218+
## Load symbols while debugging
211219

212220
You can use the **Modules**, **Call Stack**, **Locals**, **Autos**, or any **Watch** window to load symbols or change symbol options while debugging. For more information, see [Get more familiar with how the debugger attaches to your app](../debugger/debugger-tips-and-tricks.md#modules_window).
213221

0 commit comments

Comments
 (0)