如何调试程序时崩溃瓦特/出的异常? [英] How to debug a program when it crashes w/out exception?

查看:183
本文介绍了如何调试程序时崩溃瓦特/出的异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个程序定期崩溃,但我不知道为什么。我跑在调试模式下,但没有弹出。该方案只是突然退出。我有其他错误的做抛出一个异常......但不是这一个。有没有赶上它或东西的神奇的方式?

One of my programs crashes periodically, but I don't know why. I'm running it in debug mode, but nothing pops up. The program just suddenly exits. I've had other bugs that do throw an exception...but not this one. Is there a magical way of catching it or something?

推荐答案

想必你在Visual Studio中,由于某种原因它运行它不是在调试器与未捕获的异常,在这种情况下,你可以尝试从Visual Studio之外醒目崩溃停止。看到我在 System.AccessViolationException答案从非托管代码?,特别是如何捕获崩溃转储

Presumably you're running it from within Visual Studio and for some reason it's not stopping in the debugger with an uncaught exception, in which case you could try catching the crash from outside of Visual Studio. See my answer at System.AccessViolationException from unmanaged code?, in particular how to capture a crash dump.

如果只定期崩溃,而且时间相当短的时间内,开始的Sysinternals的 procdump 。开始从外部Visual Studio的可执行文件,然后运行:

If it only crashes periodically, but within a reasonably short period of time, start with Sysinternals procdump. Start your executable from outside Visual Studio, then run:

procdump -e <YourExecutableNameOrPid>

和等待它的收获崩溃转储 - 假设它退出由于未处理的异常 - 那么荷载崩溃转储到VS 2010或WinDbg的。

and wait for it to harvest a crash dump - assuming it exits due to an unhandled exception - then load the crash dump into VS 2010 or WinDbg.

这篇关于如何调试程序时崩溃瓦特/出的异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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