Skip to content

Commit 6cd5f31

Browse files
CopilotTylerMSFT
andcommitted
Add module trace file collection guidance to C++ Modules repros section
Co-authored-by: TylerMSFT <[email protected]>
1 parent 35f7490 commit 6cd5f31

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,19 @@ After you generate the preprocessed files, it's a good idea to make sure the pro
311311

312312
Finally, attach the preprocessed repro files (*filename*.i and *modulename*.i) along with the .ifc output to your report.
313313

314+
#### To generate a module trace file
315+
316+
When issues involve C++ modules, providing a module trace file along with the preprocessed repro improves diagnostic quality and reduces turnaround time. A module trace file records detailed information about module operations during compilation.
317+
318+
1. In the developer command prompt console window, enter the command **cl /d1module:enableLogging** *trace.json* *arguments* *filename.cpp*. The *trace.json* is the desired output file name for the module trace. The *arguments* are the compilation arguments, and *filename.cpp* is the source file that reproduces the problem.
319+
320+
> [!IMPORTANT]
321+
> You must compile exactly one source file to collect a module trace. Don't use the **/MP** (multi-processor compilation) option or invoke the compiler with multiple source files. Using **/MP** or multi-source invocations can cause the trace to represent only the last compiled file or be incomplete.
322+
323+
1. If multiple translation units are involved in the problem, run separate single-file invocations to collect a trace for each relevant file. Focus on the specific file that reproduces the problem, and optionally collect one trace per relevant file.
324+
325+
Finally, attach the generated *trace.json* file along with the preprocessed repro to your report.
326+
314327
### Link repros
315328

316329
A *link repro* is the linker-generated contents of a directory, specified either by the **link\_repro** environment variable, or as an argument to the [/LINKREPRO](../build/reference/linkrepro.md) linker option. It contains build artifacts that collectively demonstrate a problem that occurs at link time. Examples include a backend crash involving Link-Time Code Generation (LTCG), or a linker crash. These build artifacts are the ones needed as linker input so the problem can be reproduced. A link repro can be created easily by using this environment variable. It enables the linker's built-in repro generation capability.

0 commit comments

Comments
 (0)