在C ++(MSVC)中打印堆栈跟踪? [英] Printing the stack trace in C++ (MSVC)?

查看:131
本文介绍了在C ++(MSVC)中打印堆栈跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C ++应用程式(使用Visual Studio 2003开发)和 Qt4 中,我'd喜欢从特定的代码行打印堆栈跟踪到控制台输出或文件。

In my C++ application (developed with Visual Studio 2003) and Qt4, I'd like to print the stack trace from a specific line of code, either to the console output or into a file.

它需要什么?
是否有任何帮助的Qt这样做?

What would it take ? Is Qt of any help to do this ?

推荐答案

StackWalker 由Jochen Kalmbach [MVP VC ++]和可用的codeproject可能是最简单的方法来做到这一点。它包含了处理底层StackWalk64 API的所有细节。

StackWalker by Jochen Kalmbach [MVP VC++] and available on codeproject is probably the easiest way to do this. It wraps up all of the details of dealing with the underlying StackWalk64 API.

这篇关于在C ++(MSVC)中打印堆栈跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆