Skip to content

Commit c5a76e6

Browse files
committed
sync
2 parents 32a23f8 + 7a9dcda commit c5a76e6

18 files changed

+148
-154
lines changed

docs/debugger/debug-using-the-just-in-time-debugger.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debug using the Just-In-Time Debugger
33
description: Debug using the Just-In-Time Debugger in Visual Studio. Just-In-Time debugging can launch Visual Studio automatically when an app returns errors or crashes.
4-
ms.date: 11/29/2023
4+
ms.date: 10/09/2024
55
ms.topic: how-to
66
helpviewer_keywords:
77
- debugging [Visual Studio], Just-In-Time
@@ -153,17 +153,17 @@ If Just-In-Time debugging doesn't start when an app crashes, even though it's en
153153

154154
The fix is to add a **DWORD Value** of **Auto**, with **Value data** of **1**, to the following registry keys:
155155

156-
- **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug**
156+
- **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug**
157157

158-
- (For 32-bit machines) **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug**
158+
- (For 32-bit apps on 64-bit machines) **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug**
159159

160160
- Windows Error Reporting could be taking over the error handling on your computer.
161161

162162
To fix this issue, use Registry Editor to add a **DWORD Value** of **Disabled**, with **Value data** of **1**, to the following registry keys:
163-
164-
- **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows\Windows Error Reporting**
165163

166-
- (For 32-bit machines) **HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting**
164+
- **HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting**
165+
166+
- (For 32-bit apps on 64-bit machines) **HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows\Windows Error Reporting**
167167

168168
For more information, see [.WER settings](/windows/desktop/wer/wer-settings).
169169

docs/debugger/diagnostic-messages-in-the-output-window.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ You can write run-time messages to the **Output** window using the <xref:System.
2828
## Output methods
2929
The <xref:System.Diagnostics.Trace> and <xref:System.Diagnostics.Debug> classes provide the following output methods:
3030

31-
- Various [Write](/dotnet/api/system.diagnostics.debug#methods) methods, which output information without breaking execution. These methods replace the `Debug.Print` method used in previous versions of Visual Basic.
31+
- Various [Write](/dotnet/api/system.diagnostics.debug#methods) methods, which output information without breaking execution. These methods replace the `Debug.Print` method used in older versions of Visual Basic.
3232

3333
- <xref:System.Diagnostics.Debug.Assert%2A?displayProperty=fullName> and <xref:System.Diagnostics.Trace.Assert%2A?displayProperty=fullName> methods, which break execution and output information if a specified condition fails. By default, the `Assert` method displays the information in a dialog box. For more information, see [Assertions in managed code](../debugger/assertions-in-managed-code.md).
3434

docs/debugger/just-my-code.md

Lines changed: 4 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debug user code with Just My Code
33
description: Just My Code is a debugging feature that automatically steps over calls to non-user code. Learn how to enable, disable, and use this feature.
4-
ms.date: 08/23/2024
4+
ms.date: 10/14/2024
55
ms.topic: how-to
66
author: mikejo5000
77
ms.author: mikejo
@@ -123,7 +123,7 @@ If first chance exceptions are enabled for the exception, the calling user-code
123123
Starting in Visual Studio 2017 version 15.8, Just My Code for code stepping is also supported. This feature also requires use of the [/JMC (Just my code debugging)](/cpp/build/reference/jmc) compiler switch. The switch is enabled by default in C++ projects. For **Call Stack** window and call stack support in Just My Code, the /JMC switch isn't required.
124124

125125
<a name="BKMK_CPP_User_and_non_user_code"></a>
126-
To be classified as user code, the PDB for the binary containing the user code must be loaded by the debugger (use the **Modules** window to check this).
126+
To be classified as user code, the PDB for the binary containing the user code must be loaded by the debugger (use the **Modules** window to check loading status).
127127

128128
For call stack behavior, such as in the **Call Stack** window, Just My Code in C++ considers only these functions to be *non-user code*:
129129

@@ -249,111 +249,6 @@ A *.natstepfilter* file is an XML file with this syntax:
249249
## <a name="BKMK_JavaScript_Just_My_Code"></a> JavaScript Just My Code
250250

251251
<a name="BKMK_JS_User_and_non_user_code"></a>
252-
JavaScript Just My Code controls stepping and call stack display by categorizing code in one of these classifications:
252+
For *.esproj* projects in Visual Studio 2022, Visual Studio Code uses a *launch.json* file to configure and customize the debugger. *launch.json* is a debugger configuration file.
253253

254-
|Classification|Description|
255-
|-|-|
256-
|**MyCode**|User code that you own and control.|
257-
|**LibraryCode**|Non-user code from libraries that you use regularly and your app relies on to function correctly (for example, jQuery).|
258-
|**UnrelatedCode**|Non-user code in your app that you don't own and your app doesn't rely on to function correctly. For example, an advertising SDK that displays ads could be UnrelatedCode.|
259-
260-
The JavaScript debugger classifies code as user or non-user in this order:
261-
262-
1. The default classifications.
263-
- Script executed by passing a string to the host-provided `eval` function is **MyCode**.
264-
- Script executed by passing a string to the `Function` constructor is **LibraryCode**.
265-
- Script in a framework reference, such as WinJS or the Azure SDK, is **LibraryCode**.
266-
- Script executed by passing a string to the `setTimeout`, `setImmediate`, or `setInterval` functions is **UnrelatedCode**.
267-
268-
2. Classifications in the *mycode.json* file of the current project.
269-
270-
Each classification step overrides the previous steps.
271-
272-
All other code is classified as **MyCode**.
273-
274-
You can modify the default classifications, and classify specific files and URLs as user or non-user code, by adding a *.json* file named *mycode.json* to the root folder of a JavaScript project. See [Customize JavaScript Just My Code](#BKMK_JS_Customize_Just_My_Code).
275-
276-
<a name="BKMK_JS_Stepping_behavior"></a>
277-
During JavaScript debugging:
278-
279-
- If a function is non-user code, **Debug** > **Step Into** (or **F11**) behaves the same as **Debug** > **Step Over** (or **F10**).
280-
- If a step begins in non-user (**LibraryCode** or **UnrelatedCode**) code, stepping temporarily behaves as if Just My Code isn't enabled. When you step back to user code, Just My Code stepping is re-enabled.
281-
- When a user code step results in leaving the current execution context, the debugger stops at the next executed user code line. For example, if a callback executes in **LibraryCode** code, the debugger continues until the next line of user code executes.
282-
- **Step Out** (or **Shift**+**F11**) stops on the next line of user code.
283-
284-
If there's no more user code, debugging continues until it ends, hits another breakpoint, or throws an error.
285-
286-
Breakpoints set in code are always hit, but the code is classified.
287-
288-
- If the `debugger` keyword occurs in **LibraryCode**, the debugger always breaks.
289-
- If the `debugger` keyword occurs in **UnrelatedCode**, the debugger doesn't stop.
290-
291-
<a name="BKMK_JS_Exception_behavior"></a>
292-
If an unhandled exception occurs in **MyCode** or **LibraryCode** code, the debugger always breaks.
293-
294-
If an unhandled exception occurs in **UnrelatedCode**, and **MyCode** or **LibraryCode** is on the call stack, the debugger breaks.
295-
296-
If first-chance exceptions are enabled for the exception, and the exception occurs in **LibraryCode** or **UnrelatedCode**:
297-
298-
- If the exception is handled, the debugger doesn't break.
299-
- If the exception isn't handled, the debugger breaks.
300-
301-
### <a name="BKMK_JS_Customize_Just_My_Code"></a> Customize JavaScript Just My Code
302-
303-
To categorize user and non-user code for a single JavaScript project, you can add a *.json* file named *mycode.json* to the root folder of the project.
304-
305-
The *mycode.json* file doesn't need to list all key value pairs. The **MyCode**, **Libraries**, and **Unrelated** values can be empty arrays.
306-
307-
*Mycode.json* files use this syntax:
308-
309-
```json
310-
{
311-
"Eval" : "Classification",
312-
"Function" : "Classification",
313-
"ScriptBlock" : "Classification",
314-
"MyCode" : [
315-
"UrlOrFileSpec",
316-
. . .
317-
"UrlOrFileSpec"
318-
],
319-
"Libraries" : [
320-
"UrlOrFileSpec",
321-
. .
322-
"UrlOrFileSpec"
323-
],
324-
"Unrelated" : [
325-
"UrlOrFileSpec",
326-
. . .
327-
"UrlOrFileSpec"
328-
]
329-
}
330-
331-
```
332-
333-
**Eval, Function, and ScriptBlock**
334-
335-
The **Eval**, **Function**, and **ScriptBlock** key value pairs determine how dynamically generated code is classified:
336-
337-
|Name|Description|
338-
|-|-|
339-
|**Eval**|Script that is executed by passing a string to the host-provided `eval` function. By default, Eval script is classified as **MyCode**.|
340-
|**Function**|Script that is executed by passing a string to the `Function` constructor. By default, Function script is classified as **LibraryCode**.|
341-
|**ScriptBlock**|Script that is executed by passing a string to the `setTimeout`, `setImmediate`, or `setInterval` functions. By default, ScriptBlock script is classified as **UnrelatedCode**.|
342-
343-
You can change the value to one of these keywords:
344-
345-
- `MyCode` classifies the script as **MyCode**.
346-
- `Library` classifies the script as **LibraryCode**.
347-
- `Unrelated` classifies the script as **UnrelatedCode**.
348-
349-
**MyCode, Libraries, and Unrelated**
350-
351-
The **MyCode**, **Libraries**, and **Unrelated** key value pairs specify the URLs or files that you want to include in a classification:
352-
353-
|Name|Description|
354-
|-|-|
355-
|**MyCode**|An array of URLs or files that are classified as **MyCode**.|
356-
|**Libraries**|An array of URLs or files that are classified as **LibraryCode**.|
357-
|**Unrelated**|An array of URLs or files that are classified as **UnrelatedCode**.|
358-
359-
The URL or file string can have one or more `*` characters, which match zero or more characters. `*` is the same as the regular expression `.*`.
254+
Visual Studio attaches the debugger only to user code. For *.esproj* projects, you can configure user code (that is, *Just My Code* settings) in Visual Studio using the `skipFiles` setting in *launch.json*. This setting works the same as the *launch.json* settings in VS Code. For more information about *skipFiles*, see [Skipping Uninteresting Code](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_skipping-uninteresting-code).
34.3 KB
Loading
26.8 KB
Loading
40 KB
Loading

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

Lines changed: 79 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ The debugger searches for symbol files in the following locations:
8787

8888
**Third-party symbol servers**: Third-party providers of Windows applications and libraries can provide access to symbol server on the internet.
8989

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.
9292
9393
## Configure location of symbol files and loading options
9494

@@ -103,6 +103,11 @@ On the **Tools** > **Options** > **Debugging** > **Symbols** page, you can:
103103

104104
**To specify symbol locations and loading options:**
105105

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+
106111
1. In Visual Studio, open **Tools** > **Options** > **Debugging** > **Symbols** (or **Debug** > **Options** > **Symbols**).
107112

108113
2. Under **Symbol file (.pdb) locations**,
@@ -112,15 +117,15 @@ On the **Tools** > **Options** > **Debugging** > **Symbols** page, you can:
112117
1. Select the **+** symbol in the toolbar.
113118
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.
114119

115-
::: moniker range=">= vs-2022"
120+
::: moniker range=">= vs-2022"
116121
![Tools &#45; Options &#45; Debugging &#45; Symbols page](media/vs-2022/dbg-options-symbols.png "Tools &#45; Options &#45; Debugging &#45; Symbols page")
117-
::: moniker-end
118-
::: moniker range="<= vs-2019"
122+
::: moniker-end
123+
::: moniker range="<= vs-2019"
119124
![Tools &#45; Options &#45; Debugging &#45; Symbols page](media/dbg-options-symbols.gif "Tools &#45; Options &#45; Debugging &#45; Symbols page")
120-
::: moniker-end
125+
::: moniker-end
121126

122-
>[!NOTE]
123-
>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.
124129
125130
- To add a new Azure DevOps Symbol Server location:
126131

@@ -135,20 +140,79 @@ On the **Tools** > **Options** > **Debugging** > **Symbols** page, you can:
135140

136141
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.
137142

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.
140145
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**.
143148
144149
4. Specify the modules that you want the debugger to load from the **Symbol file (.pdb) locations** when it starts.
145150

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+
146170
- 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**.
147171

148172
- 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
149174

150175
5. Select **OK**.
151176

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+
![Screenshot of specifying module filters.](media/vs-2022/specify-include-list.png)
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+
![Screenshot of specifying excluded modules.](media/vs-2022/specify-exclude-list.png)
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+
152216
## Other symbol options for debugging
153217

154218
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
169233

170234
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*.
171235

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).
174238
>
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.
176240
177241
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.
178242

docs/docfx.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
"externalReference": [],
9595
"globalMetadata": {
9696
"feedback_system": "Standard",
97+
"feedback_help_link_url": "https://developercommunity.microsoft.com/VisualStudio",
98+
"feedback_help_link_type": "ask-the-community",
99+
"feedback_product_url": "https://developercommunity.visualstudio.com/VisualStudio/suggest",
97100
"breadcrumb_path": "/visualstudio/_breadcrumb/toc.json",
98101
"manager": "jmartens",
99102
"audience": "developer",

0 commit comments

Comments
 (0)