Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-29693

Support /jmc (just my code) MSVC compiler feature

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Debugger
    • None
    • Windows

    Description

      At Announcing C++ Just My Code Stepping in Visual Studio - C++ Team Blog (microsoft.com) we can see how Visual Studio can step into only user code and not into C++ STL for example.

      Visual C++ compiler needs to be configured with /jmc compiler flag, to generate additional information in the pdb files so that Visual Studio would know what to skip.

       

      At disassembly - The compiler adds a function call to user-defined functions. What does the function do? (x64 Windows executable) - Reverse Engineering Stack Exchange we can see that /jmc compiler flag adds the function __CheckForDebuggerJustMyCode which helps Visual Studio with the task at hand.

       

      The documentation of /jmc mentions:

      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.

      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.

      It would be nice if Qt Creator would know about this feature and make debugging on Windows a bit better.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              davschul David Schulz
              cadam Cristian Adam
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes