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

        • <bdo id='xBTAE'></bdo><ul id='xBTAE'></ul>

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

        C++ 在异常时显示堆栈跟踪

        时间:2023-08-03
        <tfoot id='7t4I5'></tfoot>
      2. <i id='7t4I5'><tr id='7t4I5'><dt id='7t4I5'><q id='7t4I5'><span id='7t4I5'><b id='7t4I5'><form id='7t4I5'><ins id='7t4I5'></ins><ul id='7t4I5'></ul><sub id='7t4I5'></sub></form><legend id='7t4I5'></legend><bdo id='7t4I5'><pre id='7t4I5'><center id='7t4I5'></center></pre></bdo></b><th id='7t4I5'></th></span></q></dt></tr></i><div id='7t4I5'><tfoot id='7t4I5'></tfoot><dl id='7t4I5'><fieldset id='7t4I5'></fieldset></dl></div>
          <tbody id='7t4I5'></tbody>

              <bdo id='7t4I5'></bdo><ul id='7t4I5'></ul>

              • <legend id='7t4I5'><style id='7t4I5'><dir id='7t4I5'><q id='7t4I5'></q></dir></style></legend>
              • <small id='7t4I5'></small><noframes id='7t4I5'>

                  本文介绍了C++ 在异常时显示堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如果抛出异常,我想有一种方法向用户报告堆栈跟踪.做这个的最好方式是什么?是否需要大量额外的代码?

                  I want to have a way to report the stack trace to the user if an exception is thrown. What is the best way to do this? Does it take huge amounts of extra code?

                  回答问题:

                  如果可能的话,我希望它是便携的.我希望弹出信息,以便用户可以复制堆栈跟踪,并在出现错误时通过电子邮件将其发送给我.

                  I'd like it to be portable if possible. I want information to pop up, so the user can copy the stack trace and email it to me if an error comes up.

                  推荐答案

                  这取决于哪个平台.

                  在 GCC 上,这非常简单,请参阅 这篇文章了解更多详情.

                  On GCC it's pretty trivial, see this post for more details.

                  在 MSVC 上,您可以使用 StackWalker 库来处理所有Windows 所需的底层 API 调用.

                  On MSVC then you can use the StackWalker library that handles all of the underlying API calls needed for Windows.

                  您必须找出将此功能集成到您的应用程序中的最佳方式,但您需要编写的代码量应该最少.

                  You'll have to figure out the best way to integrate this functionality into your app, but the amount of code you need to write should be minimal.

                  这篇关于C++ 在异常时显示堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:C++ 是否支持“finally"块?(我一直听到的这个“ 下一篇:我什么时候应该真正使用 noexcept?

                  相关文章

                  最新文章

                    <legend id='Vaeoq'><style id='Vaeoq'><dir id='Vaeoq'><q id='Vaeoq'></q></dir></style></legend>

                      <bdo id='Vaeoq'></bdo><ul id='Vaeoq'></ul>
                  1. <tfoot id='Vaeoq'></tfoot>
                    <i id='Vaeoq'><tr id='Vaeoq'><dt id='Vaeoq'><q id='Vaeoq'><span id='Vaeoq'><b id='Vaeoq'><form id='Vaeoq'><ins id='Vaeoq'></ins><ul id='Vaeoq'></ul><sub id='Vaeoq'></sub></form><legend id='Vaeoq'></legend><bdo id='Vaeoq'><pre id='Vaeoq'><center id='Vaeoq'></center></pre></bdo></b><th id='Vaeoq'></th></span></q></dt></tr></i><div id='Vaeoq'><tfoot id='Vaeoq'></tfoot><dl id='Vaeoq'><fieldset id='Vaeoq'></fieldset></dl></div>
                    1. <small id='Vaeoq'></small><noframes id='Vaeoq'>