如何劫持-在异常点获取堆栈跟踪... [英] How to hijack throw -- get stack trace at exception point...

查看:106
本文介绍了如何劫持-在异常点获取堆栈跟踪...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个同事(在Mac上)具有一些可以劫持"throw"的代码,以便在引发异常时生成堆栈跟踪.

我想知道是否有一些用于Windows的预制东西可以完成相同的任务?

A colleague of mine (on a mac) has some code which can hijack the "throw" in order to produce a stack trace at the point the exception is thrown.

I was wondering if there were some pre-built stuff for windows to accomplish the same?

推荐答案

请看一下文章:Microsoft Visual C ++和Win32结构化异常处理 [
Have a look at the article: Microsoft Visual C++ and Win32 structured exception handling[^].


我不知道这是否对您有帮助,但是您当引发异常时,可以使VS调试器中断.在Debug中->例外对话框,您可以选择要用这种方式处理的例外.

显然,这仅在调试时有效.如果您希望能够跟踪到日志文件,请遵循Pallini先生的链接.
I don''t know if this will help you, but you can make the VS debugger break when an exception is thrown. In the Debug -> Exceptions Dialog, you can select which exceptions to handle this way.

This obviously only works when debugging. If you want to be able to trace to a log file, follow Mr Pallini''s link.


这篇关于如何劫持-在异常点获取堆栈跟踪...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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