How to debug local variable and lambda on c++ release build

The solution is to turn the optimization off on your scripts using

#pragma optimize("", off)
#pragma optimize("", off)
bool a = true; // <-- This can be debugged in a release
#pragma optimize("", on)
bool b = false; // <-- This can't be debugged in a release



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • How to debug MSVC in release mode
  • How to change the line endings in Linux
  • How to find the vc runtime version from an exe
  • Why auto is bad in c++
  • Deep Copy/Shadow Copy an Object in Java