/Zo (Enhance Optimized Debugging)

Generate enhanced debugging information for optimized code in non-debug builds.

/Zo[-]

Remarks

The /Zo compiler switch generates enhanced debugging information for optimized code. Optimization may use registers for local variables, reorder code, vectorize loops, and inline function calls. These optimizations can obscure the relationship between the source code and the compiled object code. The /Zo switch tells the compiler to generate additional debugging and profiling information for local variables and inlined functions. Use it to see variables in the Autos, Locals, and Watch windows when you step through optimized code in the Visual Studio debugger. It also enables stack traces to show inlined functions in the WinDBG debugger. Debug builds that have disabled optimizations (/Od) do not need the additional debugging information generated when /Zo is specified. Use the /Zo switch to debug Release configurations with optimization turned on. For more information on optimization switches, see /O Options (Optimize Code). Because /Zo can increase the size of .PDB files, it is disabled by default in Visual Studio 2013. Specify /Zo- to explicitly disable this compiler option.

The Visual Studio 2013 debugger that takes advantage of the enhanced debugging information generated by the /Zo switch is not compatible with native Edit and Continue. If you enable native Edit and Continue in the Debugger options, Visual Studio 2013 uses a different debugging engine, and the enhanced debugging information generated by the /Zo switch is ignored.

The /Zo switch is available in Visual Studio 2013 Update 3, and it replaces the previously undocumented /d2Zi+ switch. We recommend you use /Zo instead.

To set the /Zo compiler option in Visual Studio

  1. Open the Property Pages dialog box for the project. For more information, see How to: Open Project Property Pages.

  2. Select the Configuration Properties, C/C++ folder.

  3. Select the Command Line property page.

  4. Modify the Additional Options property to include /Zo and then choose OK.

To set this compiler option programmatically

See Also

Reference

/O Options (Optimize Code)

Concepts

Edit and Continue