现在的位置: 首页 > 综合 > 正文

Release调试

2019年03月17日 ⁄ 综合 ⁄ 共 347字 ⁄ 字号 评论关闭

Release 下想调试代码只需要修改一下设置:

  1. 右键当前工程, 选择properties
  2. 选择 All Configurations
  3. C++>General->Debug Information Format->Program Database (/Zi)
  4. C++>Optimization->Optimization->Disabled (/Od)
  5. Linker->Debugging->Generate Debug Info->Yes (/DEBUG)
  6. Linker->Debugging->Generate Program Database File->$(TargetDir)$(TargetName).pdb (default path)

注意要把优化关掉,否则很多变量的内容是无法查看到,比如编译器很可能用寄存器等优化掉了变量。

抱歉!评论已关闭.