我通过执行以下操作设置未处理的异常过滤器: SetUnhandledExceptionFilter(UnhandledException)
在我的 UnhandledException 函数中,我使用 MiniDumpWriteDump 写出一个 minidump:
MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, excpInfo? &eInfo : NULL, NULL, NULL);
当我查看 WinDbg 中的堆栈跟踪时,我看不到太多:
0:023> KB ChildEBP RetAddr Args to Child 警告:堆栈展开信息不可用。以下框架可能是错误的。 15e7e7dc 08f00150 08f00a78 08f00000 08f00150 ntdll!ZwGetContextThread+0x12 15e7e7fc 777d301e 6f00016e 00000044 627e056a 0x8f00150 15e7e890 777d2ffa 777d2bf2 00000000 00650000 ntdll!RtlInterlockedFlushSList+0x889 15e7e894 777d2bf2 00000000 00650000 077e1b88 ntdll!RtlInterlockedFlushSList+0x865 15e7e8b4 772b14d1 08f00000 00000000 077e0c48 ntdll!RtlInterlockedFlushSList+0x45d 15e7e8d0 777ce023 077e1b88 08f00138 00000001 kernel32!HeapFree+0x14 15e7e8e8 777d48c6 777bfafa 777d419a ffffffff ntdll!RtlFreeHeap+0x7e 15e7e914 777e9ed7 ffffffff 15e7e938 15e7e944 ntdll!RtlImageNtHeader+0xe2 15e7e93c 777e9e49 00010000 00000000 08c70000 ntdll!RtlDestroyHeap+0x139 15e7e958 75d5458e 08f00000 00000000 08ccfe46 ntdll!RtlDestroyHeap+0xab 15e7e9c4 777ce023 104d9250 104d91f0 104d9250 KERNELBASE!HeapDestroy+0xe 00000000 00000000 00000000 00000000 00000000 ntdll!RtlFreeHeap+0x7e
MiniDumpWriteDump 文档提到 strack 跟踪可能不好,但我真的不明白我应该怎么做:http: //msdn.microsoft.com/en-us/library/ms680360%28v=vs.85 %29.aspx
任何帮助表示赞赏!