0

I have a C++ project experiencing one of those annoying problems that show up in Release but not Debug build.

So I want to create a third build configuration that is identical to Release except that it generates the PDB files (anything else?) that are needed to support step debugging and value inspection within a VS debug session when it hits an exception.

What Compiler and Linker settings do I need to change to enable this?

stephen
  • 303
  • 1
  • 8

1 Answers1

0

Once you enable optimizations, you aren't able to inspect things that are optimized away.
When you see such an entity, switching to Assembly mode with source lines alongside and looking at the processor instructions can give you hints where it went (e.g. a variable could have been moved into a register, then you can inspect the register instead).

PDB generation is enabled by default in Release configuration in VS2008. If not, the linked question lists the relevant settings.

Community
  • 1
  • 1
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152