开发者

How to ensure a dump file is written by C++ application in case of unhandled exception

How to ensure a dump file is written by C++ application in case of exception which is not handled.

For example 开发者_运维技巧if division by zero is not handled then how do ensure Dump is written.

Also It will be great to have windbg tutorial I tried searching on but NOT a good one found .


I'm assuming you're looking for an external way to get those dumps created (after all, you're asking about exceptions that are not handled).

In Vista and above, the mechanism you're looking for is called Windows Error Reporting - WER. You can configure it to create dumps upon crash, and place them at a certain location. Prior to Vista, you could do that using drwtsn32.exe. You can also run your program using ADPlus, which will create a dump as soon as the process crashes, without the need for any system-wide configuration.

If you'd like to create a dump from the program itself, you can use MiniDumpWriteDump , but that's less advisable. When in an unclear state, it's better to let some other process take the snapshot of yours.

As for WinDbg, there's really a ton of information on the web. I guess you can start here, but you should ask specific questions if you have specific problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜