Skip to content

Commit 3f58ed5

Browse files
authored
Merge pull request #4144 from corob-msft/docs/corob/TC1587815
Add info for TC1587815 JMC in code coverage
2 parents 3dc318b + 21594fb commit 3f58ed5

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

docs/build/reference/jmc.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
---
22
description: "Learn more about: /JMC (Just My Code debugging)"
33
title: "/JMC (Just My Code debugging)"
4-
ms.date: "08/20/2018"
4+
ms.date: 03/01/2022
55
f1_keywords: ["VC.Project.VCCLCompilerTool.SupportJustMyCode"]
66
helpviewer_keywords: ["/JMC compiler option [C++]", "Just my code [C++]", "-JMC compiler option [C++]", "User code, debugging", "JMC compiler option [C++]"]
77
---
8-
# /JMC (Just My Code debugging)
8+
# `/JMC` (Just My Code debugging)
99

10-
Specifies compiler support for native *Just My Code* debugging in the Visual Studio debugger. This option supports the user settings that allow Visual Studio to step over system, framework, library, and other non-user calls, and to collapse those calls in the call stack window. The **/JMC** compiler option is available starting in Visual Studio 2017 version 15.8.
10+
Specifies compiler support for native *Just My Code* debugging in the Visual Studio debugger. This option supports the user settings that allow Visual Studio to step over system, framework, library, and other non-user calls, and to collapse those calls in the call stack window. The **`/JMC`** compiler option is available starting in Visual Studio 2017 version 15.8.
1111

1212
## Syntax
1313

14-
> **/JMC**\[**-**]
14+
> **`/JMC`**\[**`-`**]
1515
1616
## Remarks
1717

18-
The Visual Studio [Just My Code](/visualstudio/debugger/just-my-code) settings specify whether the Visual Studio debugger steps over system, framework, library, and other non-user calls. The **/JMC** compiler option enables support for Just My Code debugging in your native C++ code. When **/JMC** is enabled, the compiler inserts calls to a helper function, `__CheckForDebuggerJustMyCode`, in the function prolog. The helper function provides hooks that support Visual Studio debugger Just My Code step operations. To enable Just My Code in the Visual Studio debugger, on the menu bar, choose **Tools** > **Options**, and then set the option in **Debugging** > **General** > **Enable Just My Code**.
18+
The Visual Studio [Just My Code](/visualstudio/debugger/just-my-code#BKMK_C___Just_My_Code) settings specify whether the Visual Studio debugger steps over system, framework, library, and other non-user calls. The **`/JMC`** compiler option enables support for Just My Code debugging in your native C++ code. When **`/JMC`** is enabled, the compiler inserts calls to a helper function, `__CheckForDebuggerJustMyCode`, in the function prolog. The helper function provides hooks that support Visual Studio debugger Just My Code step operations. To enable Just My Code in the Visual Studio debugger, on the menu bar, choose **Tools** > **Options**, and then set the option in **Debugging** > **General** > **Enable Just My Code**.
1919

20-
The **/JMC** option requires that your code links to the C Runtime Library (CRT), which provides the `__CheckForDebuggerJustMyCode` helper function. If your project does not link to the CRT, you may see linker error **LNK2019: unresolved external symbol __CheckForDebuggerJustMyCode**. To resolve this error, either link to the CRT, or disable the **/JMC** option.
20+
The **`/JMC`** option requires that your code links to the C Runtime Library (CRT), which provides the `__CheckForDebuggerJustMyCode` helper function. If your project doesn't link to the CRT, you may see linker error **LNK2019: unresolved external symbol __CheckForDebuggerJustMyCode**. To resolve this error, either link to the CRT, or disable the **`/JMC`** option.
2121

22-
By default, the **/JMC** compiler option is off. However, starting in Visual Studio 2017 version 15.8 this option is enabled in most Visual Studio project templates. To explicitly disable this option, use the **/JMC-** option on the command line. In Visual Studio, open the project Property Pages dialog box, and change the **Support Just My Code Debugging** property in the **Configuration Properties** > **C/C++** > **General** property page to **No**.
22+
When the **`/JMC`** option is enabled, the PDB file is annotated with extra line number information. In versions before Visual Studio 2019 version 16.8, this information may appear in code coverage reports as occurring at line 15732480 (0xF00F00) or 16707566 (0xFEEFEE). These fictitious line numbers are used as markers to delineate user code from non-user code. To include non-user code in code coverage reports without these unexpected line numbers, build your code with the **`/JMC-`** option.
23+
24+
By default, the **`/JMC`** compiler option is off. However, starting in Visual Studio 2017 version 15.8 this option is enabled in most Visual Studio project templates. To explicitly disable this option, use the **`/JMC-`** option on the command line. In Visual Studio, open the project Property Pages dialog box, and change the **Support Just My Code Debugging** property in the **Configuration Properties** > **C/C++** > **General** property page to **No**.
2325

2426
For more information, see [C++ Just My Code](/visualstudio/debugger/just-my-code#BKMK_C___Just_My_Code) in [Specify whether to debug only user code using Just My Code in Visual Studio](/visualstudio/debugger/just-my-code), and the Visual C++ Team Blog post [Announcing C++ Just My Code Stepping in Visual Studio](https://devblogs.microsoft.com/cppblog/announcing-jmc-stepping-in-visual-studio/).
2527

@@ -37,5 +39,5 @@ For more information, see [C++ Just My Code](/visualstudio/debugger/just-my-code
3739

3840
## See also
3941

40-
[MSVC Compiler Options](compiler-options.md)<br/>
41-
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)<br/>
42+
[MSVC compiler options](compiler-options.md)\
43+
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)

0 commit comments

Comments
 (0)