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/code-quality/install-fxcop-analyzers.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Use the following guidelines to determine which version of the FxCop analyzers p
37
37
38
38
| Visual Studio version | FxCop analyzer package version |
39
39
| - | - |
40
-
| Visual Studio 2017 version 15.5 and later | 2.6.2, for example https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.6.2|
40
+
| Visual Studio 2017 version 15.5 and later | 2.6.3, for example https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.6.3|
41
41
| Visual Studio 2017 version 15.3 to 15.4 | 2.3.0-beta1, for example https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.3.0-beta1|
42
42
| Visual Studio 2017 version 15.0 to 15.2 | 2.0.0-beta2, for example https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.0.0-beta2|
43
43
| Visual Studio 2015 update 2 and 3 | Version 1.2.0-beta2, for example https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/1.2.0-beta2|
title: "Debug user code with Just My Code | Microsoft Docs"
3
-
ms.date: "10/22/2018"
3
+
ms.date: "02/13/2019"
4
4
ms.topic: "conceptual"
5
5
ms.assetid: 0f0df097-bbaf-46ad-9ad1-ef5f40435079
6
6
author: "mikejo5000"
@@ -76,25 +76,25 @@ If an unhandled exception occurs in non-user code, the debugger breaks at the us
76
76
If first chance exceptions are enabled for the exception, the calling user-code line is highlighted in green in source code. The **Call Stack** window displays the annotated frame labeled **[External Code]**.
77
77
78
78
## <aname="BKMK_C___Just_My_Code"></a> C++ Just My Code
79
-
80
-
In C++, enabling Just My Code is the same as using the [/JMC (Just my code debugging)](/cpp/build/reference/jmc) compiler switch.
79
+
80
+
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. For **Call Stack** window and call stack support in Just My Code, the /JMC switch is not required.
81
81
82
82
<aname="BKMK_CPP_User_and_non_user_code"></a>
83
-
Just My Code is different in C++ than in .NET Framework and JavaScript, because you can specify non-user files separately for stepping behavior and the **Call Stack** window.
84
-
85
-
Just My Code in C++ considers only these functions to be non-user code:
86
-
87
-
- For the **Call Stack** window:
83
+
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).
88
84
89
-
- Functions with stripped source information in their symbols file.
90
-
- Functions where the symbol files indicate that there is no source file corresponding to the stack frame.
91
-
- Functions specified in *\*.natjmc* files in the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
85
+
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*:
92
86
93
-
- For stepping behavior:
87
+
- Functions with stripped source information in their symbols file.
88
+
- Functions where the symbol files indicate that there is no source file corresponding to the stack frame.
89
+
- Functions specified in *\*.natjmc* files in the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
90
+
91
+
For code stepping behavior, Just My Code in C++ considers only these functions to be *non-user code*:
92
+
93
+
- Functions for the which the corresponding PDB file has not been loaded in the debugger.
94
+
- Functions specified in *\*.natjmc* files in the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
94
95
95
-
- Functions specified in *\*.natstepfilter* files in the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
96
-
97
-
You can create *.natstepfilter* and *.natjmc* files to customize Just My Code stepping behavior and the **Call Stack** window. See [Customize C++ stepping behavior](#BKMK_CPP_Customize_stepping_behavior) and [Customize C++ call stack behavior](#BKMK_CPP_Customize_call_stack_behavior).
96
+
> [!NOTE]
97
+
> For code stepping support in Just My Code, C++ code must be compiled using the MSVC compilers in Visual Studio 15.8 Preview 3 or later, and the /JMC compiler switch must be enabled (it is enabled by default). For additional details, see [Customize C++ call stack and code stepping behavior](#BKMK_CPP_Customize_call_stack_behavior)) and this [blog post](https://blogs.msdn.microsoft.com/vcblog/2018/06/29/announcing-jmc-stepping-in-visual-studio/). For code compiled using an older compiler, *.natstepfilter* files are the only way to customize code stepping, which is independent of Just My Code. See [Customize C++ stepping behavior](#BKMK_CPP_Customize_stepping_behavior).
98
98
99
99
<aname="BKMK_CPP_Stepping_behavior"></a>
100
100
During C++ debugging:
@@ -106,118 +106,118 @@ If there's no more user code, debugging continues until it ends, hits another br
106
106
107
107
If the debugger breaks in non-user code (for example, you use **Debug** > **Break All** and pause in non-user code), stepping continues in the non-user code.
108
108
109
-
If the debugger hits an exception, it stops on the exception, whether it is in user or non-user code. **User-unhandled** options in the **Exception Settings** dialog box are ignored.
110
-
111
-
### <aname="BKMK_CPP_Customize_stepping_behavior"></a> Customize C++ stepping behavior
112
-
113
-
In C++ projects, you can specify functions to step over by listing them as non-user code in *\*.natstepfilter* files.
114
-
115
-
- To specify non-user code for all local Visual Studio users, add the *.natstepfilter* file to the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
116
-
- To specify non-user code for an individual user, add the *.natstepfilter* file to the *%USERPROFILE%\My Documents\Visual Studio 2017\Visualizers* folder.
117
-
118
-
A *.natstepfilter* file is an XML file with this syntax:
|`Function`|Required. Specifies one or more functions as non-user functions.|
139
-
|`Name`|Required. An ECMA-262 formatted regular expression specifying the full function name to match. For example:<br /><br /> `<Name>MyNS::MyClass.*</Name>`<br /><br /> tells the debugger that all methods in `MyNS::MyClass` are to be considered non-user code. The match is case-sensitive.|
140
-
|`Module`|Optional. An ECMA-262 formatted regular expression specifying the full path to the module containing the function. The match is case-insensitive.|
141
-
|`Action`|Required. One of these case-sensitive values:<br /><br /> `NoStepInto` - tells the debugger to step over the function.<br /> `StepInto` - tells the debugger to step into the function, overriding any other `NoStepInto` for the matched function.|
142
-
143
-
### <aname="BKMK_CPP_Customize_call_stack_behavior"></a> Customize C++ call stack behavior
144
-
145
-
For C++ projects, you can specify the modules, source files, and functions the **Call Stack** window treats as non-user code by specifying them in *\*.natjmc* files.
146
-
147
-
- To specify non-user code for all users of the Visual Studio machine, add the *.natjmc* file to the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
148
-
- To specify non-user code for an individual user, add the *.natjmc* file to the *%USERPROFILE%\My Documents\Visual Studio 2017\Visualizers* folder.
|`Name`|Required. The full path of the module or modules. You can use the Windows wildcard characters `?` (zero or one character) and `*` (zero or more characters). For example,<br /><br /> `<Module Name="?:\3rdParty\UtilLibs\*" />`<br /><br /> tells the debugger to treat all modules in *\3rdParty\UtilLibs* on any drive as external code.|
177
-
|`Company`|Optional. The name of the company that publishes the module that is embedded in the executable file. You can use this attribute to disambiguate the modules.|
178
-
179
-
**File element attributes**
180
-
181
-
|Attribute|Description|
182
-
|---------------|-----------------|
183
-
|`Name`|Required. The full path of the source file or files to treat as external code. You can use the Windows wildcard characters `?` and `*` when specifying the path.|
184
-
185
-
**Function element attributes**
186
-
187
-
|Attribute|Description|
188
-
|---------------|-----------------|
189
-
|`Name`|Required. The fully qualified name of the function to treat as external code.|
190
-
|`Module`|Optional. The name or full path to the module that contains the function. You can use this attribute to disambiguate functions with the same name.|
191
-
|`ExceptionImplementation`|When set to `true`, the call stack displays the function that threw the exception rather than this function.|
192
-
193
-
## <aname="BKMK_JavaScript_Just_My_Code"></a> JavaScript Just My Code
194
-
195
-
<aname="BKMK_JS_User_and_non_user_code"></a>
196
-
JavaScript Just My Code controls stepping and call stack display by categorizing code in one of these classifications:
197
-
198
-
|||
199
-
|-|-|
200
-
|**MyCode**|User code that you own and control.|
201
-
|**LibraryCode**|Non-user code from libraries that you use regularly and your app relies on to function correctly (for example WinJS or jQuery).|
202
-
|**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. In UWP projects, any code that is loaded into your app from an HTTP or HTTPS URI is also considered UnrelatedCode.|
203
-
204
-
The JavaScript debugger classifies code as user or non-user in this order:
205
-
206
-
1. The default classifications.
207
-
- Script executed by passing a string to the host-provided `eval` function is **MyCode**.
208
-
- Script executed by passing a string to the `Function` constructor is **LibraryCode**.
209
-
- Script in a framework reference, such as WinJS or the Azure SDK, is **LibraryCode**.
210
-
- Script executed by passing a string to the `setTimeout`, `setImmediate`, or `setInterval` functions is **UnrelatedCode**.
211
-
212
-
2. Classifications specified for all Visual Studio JavaScript projects in the *%VSInstallDirectory%\JavaScript\JustMyCode\mycode.default.wwa.json* file.
213
-
214
-
3. Classifications in the *mycode.json* file of the current project.
215
-
216
-
Each classification step overrides the previous steps.
217
-
218
-
All other code is classified as **MyCode**.
219
-
220
-
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).
109
+
If the debugger hits an exception, it stops on the exception, whether it is in user or non-user code. **User-unhandled** options in the **Exception Settings** dialog box are ignored.
110
+
111
+
### <aname="BKMK_CPP_Customize_call_stack_behavior"></a> Customize C++ call stack and code stepping behavior
112
+
113
+
For C++ projects, you can specify the modules, source files, and functions the **Call Stack** window treats as non-user code by specifying them in *\*.natjmc* files. This customization also applies to code stepping if you are using the latest compiler (see [C++ Just My Code](#BKMK_CPP_User_and_non_user_code)).
114
+
115
+
- To specify non-user code for all users of the Visual Studio machine, add the *.natjmc* file to the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
116
+
- To specify non-user code for an individual user, add the *.natjmc* file to the *%USERPROFILE%\My Documents\Visual Studio 2017\Visualizers* folder.
|`Name`|Required. The full path of the module or modules. You can use the Windows wildcard characters `?` (zero or one character) and `*` (zero or more characters). For example,<br /><br /> `<Module Name="?:\3rdParty\UtilLibs\*" />`<br /><br /> tells the debugger to treat all modules in *\3rdParty\UtilLibs* on any drive as external code.|
145
+
|`Company`|Optional. The name of the company that publishes the module that is embedded in the executable file. You can use this attribute to disambiguate the modules.|
146
+
147
+
**File element attributes**
148
+
149
+
|Attribute|Description|
150
+
|---------------|-----------------|
151
+
|`Name`|Required. The full path of the source file or files to treat as external code. You can use the Windows wildcard characters `?` and `*` when specifying the path.|
152
+
153
+
**Function element attributes**
154
+
155
+
|Attribute|Description|
156
+
|---------------|-----------------|
157
+
|`Name`|Required. The fully qualified name of the function to treat as external code.|
158
+
|`Module`|Optional. The name or full path to the module that contains the function. You can use this attribute to disambiguate functions with the same name.|
159
+
|`ExceptionImplementation`|When set to `true`, the call stack displays the function that threw the exception rather than this function.|
160
+
161
+
###<aname="BKMK_CPP_Customize_stepping_behavior"></a> Customize C++ stepping behavior independent of Just My Code settings
162
+
163
+
In C++ projects, you can specify functions to step over by listing them as non-user code in *\*.natstepfilter* files. Functions listed in *\*.natstepfilter* files are not dependent on Just My Code settings.
164
+
165
+
- To specify non-user code for all local Visual Studio users, add the *.natstepfilter* file to the *%VsInstallDirectory%\Common7\Packages\Debugger\Visualizers* folder.
166
+
- To specify non-user code for an individual user, add the *.natstepfilter* file to the *%USERPROFILE%\My Documents\Visual Studio 2017\Visualizers* folder.
167
+
168
+
A *.natstepfilter* file is an XML file with this syntax:
|`Function`|Required. Specifies one or more functions as non-user functions.|
189
+
|`Name`|Required. An ECMA-262 formatted regular expression specifying the full function name to match. For example:<br /><br /> `<Name>MyNS::MyClass.*</Name>`<br /><br /> tells the debugger that all methods in `MyNS::MyClass` are to be considered non-user code. The match is case-sensitive.|
190
+
|`Module`|Optional. An ECMA-262 formatted regular expression specifying the full path to the module containing the function. The match is case-insensitive.|
191
+
|`Action`|Required. One of these case-sensitive values:<br /><br /> `NoStepInto` - tells the debugger to step over the function.<br /> `StepInto` - tells the debugger to step into the function, overriding any other `NoStepInto` for the matched function.|
192
+
193
+
## <aname="BKMK_JavaScript_Just_My_Code"></a> JavaScript Just My Code
194
+
195
+
<aname="BKMK_JS_User_and_non_user_code"></a>
196
+
JavaScript Just My Code controls stepping and call stack display by categorizing code in one of these classifications:
197
+
198
+
|||
199
+
|-|-|
200
+
|**MyCode**|User code that you own and control.|
201
+
|**LibraryCode**|Non-user code from libraries that you use regularly and your app relies on to function correctly (for example WinJS or jQuery).|
202
+
|**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. In UWP projects, any code that is loaded into your app from an HTTP or HTTPS URI is also considered UnrelatedCode.|
203
+
204
+
The JavaScript debugger classifies code as user or non-user in this order:
205
+
206
+
1. The default classifications.
207
+
-Script executed by passing a string to the host-provided `eval` function is **MyCode**.
208
+
-Script executed by passing a string to the `Function` constructor is **LibraryCode**.
209
+
-Script in a framework reference, such as WinJS or the Azure SDK, is **LibraryCode**.
210
+
-Script executed by passing a string to the `setTimeout`, `setImmediate`, or `setInterval` functions is **UnrelatedCode**.
211
+
212
+
2. Classifications specified for all Visual Studio JavaScript projects in the *%VSInstallDirectory%\JavaScript\JustMyCode\mycode.default.wwa.json* file.
213
+
214
+
3. Classifications in the *mycode.json* file of the current project.
215
+
216
+
Each classification step overrides the previous steps.
217
+
218
+
All other code is classified as **MyCode**.
219
+
220
+
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).
0 commit comments