GDC 2025: C++ Dynamic Debugging: Full Debuggability for Optimized Builds

C++ Dynamic Debugging gives you the performance of optimized code with the debugging experience of unoptimized code

March 19, 2025
Visual Studio 2022 Recap Hero image

Over the past 5 years, the Visual Studio team has had many incredible opportunities to engage with game developers. Through our conversations, we’ve heard about some common problems when debugging optimized code:

  • Trying to inspect locals often yields the "Variable is optimized away" message in the watch window.
  • Step-over and step-into don't always step over, or into, the expected code paths.
  • Losing time while iterating with #pragma optimize to try and undo optimizations, requiring a rebuild and restart of the debugger.

Announcing: C++ Dynamic Debugging

We are thrilled to announce C++ Dynamic Debugging: Full Debuggability for Optimized Builds. This feature is now available as a preview feature exclusively with the MSVC toolset. C++ Dynamic Debugging dynamically deoptimizes code that you set breakpoints on or step into, giving you the performance of optimized code with the debugging experience of unoptimized code.

Try C++ Dynamic Debugging today in Visual Studio 2022 version 17.14 Preview 2 by downloading it here.

Visual Studio inline image

Without C++ Dynamic Debugging

Using C++ Dynamic Debugging will allow Visual Studio to dynamically deoptimize frames you care about.

Visual Studio inline image

With C++ Dynamic Debugging

“The new feature is exceptional. I now have reliable stepwise debugging, variable inspection, and program counter jumping without needing to recompile with pragma optimize.” – Jess Kube, Principal Software Engineer, The Coalition

Using it daily, the new feature improved my ability to debug and investigate quicker. I don’t need to manually deoptimize my files anymore” – Matthew Koch, Principal Software Engineer, Halo Studios

“With the new feature, breakpoints in inlined functions will now be hit. Previously, I had to use a debug build or #pragma optimize and remember to remove it before code review” – Keith Stockdale, Senior Software Engineer, Rare

For detailed setup instructions, please visit C++ Dynamic Debugging: Full Debuggability for Optimized Builds on Visual Studio C++ Team Blogs.