<bdo id='TBawm'></bdo><ul id='TBawm'></ul>

  1. <small id='TBawm'></small><noframes id='TBawm'>

    <tfoot id='TBawm'></tfoot>
  2. <legend id='TBawm'><style id='TBawm'><dir id='TBawm'><q id='TBawm'></q></dir></style></legend>
    <i id='TBawm'><tr id='TBawm'><dt id='TBawm'><q id='TBawm'><span id='TBawm'><b id='TBawm'><form id='TBawm'><ins id='TBawm'></ins><ul id='TBawm'></ul><sub id='TBawm'></sub></form><legend id='TBawm'></legend><bdo id='TBawm'><pre id='TBawm'><center id='TBawm'></center></pre></bdo></b><th id='TBawm'></th></span></q></dt></tr></i><div id='TBawm'><tfoot id='TBawm'></tfoot><dl id='TBawm'><fieldset id='TBawm'></fieldset></dl></div>

      如何在发布模式下调试?

      How to debug in release mode?(如何在发布模式下调试?)
      <tfoot id='HUMWJ'></tfoot>
        <tbody id='HUMWJ'></tbody>

          <bdo id='HUMWJ'></bdo><ul id='HUMWJ'></ul>
          • <legend id='HUMWJ'><style id='HUMWJ'><dir id='HUMWJ'><q id='HUMWJ'></q></dir></style></legend>

              • <i id='HUMWJ'><tr id='HUMWJ'><dt id='HUMWJ'><q id='HUMWJ'><span id='HUMWJ'><b id='HUMWJ'><form id='HUMWJ'><ins id='HUMWJ'></ins><ul id='HUMWJ'></ul><sub id='HUMWJ'></sub></form><legend id='HUMWJ'></legend><bdo id='HUMWJ'><pre id='HUMWJ'><center id='HUMWJ'></center></pre></bdo></b><th id='HUMWJ'></th></span></q></dt></tr></i><div id='HUMWJ'><tfoot id='HUMWJ'></tfoot><dl id='HUMWJ'><fieldset id='HUMWJ'></fieldset></dl></div>

                <small id='HUMWJ'></small><noframes id='HUMWJ'>

                本文介绍了如何在发布模式下调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我必须调试一个 C++ 项目,但由于一个依赖项无法在调试模式下编译,而且我目前还无法解决该问题,我想尝试在发布模式下调试该项目.

                I have to debug a c++ project, but as one dependency doesn't compile in debug mode and I haven't been able to fix that issue so far, I'd like to try to debug the project in release mode.

                目前应用程序由于空指针而崩溃,但我没有导致错误的代码.由于断点显然在发布模式下被忽略,我想知道找到错误的最佳方法是什么.

                Currently the application crashes due to a null pointer, but I haven't the code that's causing the error. As break points apparently are ignored in release-mode, I'd like to know what's the best way find the error.

                推荐答案

                在 VS 中,右键单击您的项目,选择属性".

                In VS, right click your project, chose "Properties".

                1. 单击 C/C++ 节点.将调试信息格式设置为 C7 兼容 (/Z7) 或程序数据库 (/Zi).

                1. Click the C/C++ node. Set Debug Information Format to C7 compatible (/Z7) or Program Database (/Zi).

                展开链接器并单击常规节点.将启用增量链接设置为否 (/INCREMENTAL:NO).

                Expand Linker and click the General node. Set Enable Incremental Linking to No (/INCREMENTAL:NO).

                选择调试节点.将生成调试信息设置为是 (/DEBUG).

                Select the Debugging node. Set Generate Debug Info to Yes (/DEBUG).

                选择优化节点.将引用设置为是 (/OPT:REF).

                Select the Optimization node. Set References to Yes (/OPT:REF).

                如果指定了/OPT:REF,则/OPT:ICF 默认开启.

                if /OPT:REF is specified, /OPT:ICF is on by default.

                这是直接从微软的文档中撕下来的:

                That's ripped directly from Microsoft's documentation:

                • 如何:调试发布版本
                • OPT 优化

                我一直这样做,几乎不再在调试模式下调试了.如您所知,发布版本中发生的许多错误可能不会发生在调试版本中(几乎可以肯定是调用 UB 引起的错误).

                I do this all of the time and pretty much never debug in debug mode anymore. As you know, many errors that occur in a release build may not occur in a debug build (almost certainly the errors that arise from invoking UB).

                此外,我从事一个项目,该项目使用大量图像处理并对大图像执行大量压缩/解压缩.使用缓慢的调试版本是不切实际的.

                Also, I work on a project which uses a ton of image processing and performs a lot of compression/decompression of large images. Using a slow debug build is simply impractical.

                这篇关于如何在发布模式下调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How to print vector#39;s data(如何打印矢量的数据)
                Visual C++ appends 0xCC (int3) bytes at the end of functions(Visual C++ 在函数末尾附加 0xCC (int3) 字节)
                How to use a variable inside a _T wrapper?(如何在 _T 包装器中使用变量?)
                MSVC++ warning flags(MSVC++ 警告标志)
                How to read file which contains uxxxx in vc++(如何在vc++中读取包含uxxxx的文件)
                stack overflow error in C++ program(C++程序中的堆栈溢出错误)
                <i id='HwVes'><tr id='HwVes'><dt id='HwVes'><q id='HwVes'><span id='HwVes'><b id='HwVes'><form id='HwVes'><ins id='HwVes'></ins><ul id='HwVes'></ul><sub id='HwVes'></sub></form><legend id='HwVes'></legend><bdo id='HwVes'><pre id='HwVes'><center id='HwVes'></center></pre></bdo></b><th id='HwVes'></th></span></q></dt></tr></i><div id='HwVes'><tfoot id='HwVes'></tfoot><dl id='HwVes'><fieldset id='HwVes'></fieldset></dl></div>
                  • <bdo id='HwVes'></bdo><ul id='HwVes'></ul>
                      <tbody id='HwVes'></tbody>

                    1. <small id='HwVes'></small><noframes id='HwVes'>

                    2. <tfoot id='HwVes'></tfoot>
                        • <legend id='HwVes'><style id='HwVes'><dir id='HwVes'><q id='HwVes'></q></dir></style></legend>