Win7应用程序崩溃后如何调试?
我有一个 Visual Basic 6 应用程序,最近我将其更改为使用我在 Visual Studio 2008 中编写的几个 C++ DLL。该应用程序在我的 PC 上运行良好,但当我们将其安装在其中一台测试 PC 上时,它往往会出现问题。关机期间崩溃 - 我们看到 Win 7 消息“您的应用程序失败”或其他任何内容。
我知道Win 7 存储可用于分析崩溃的数据。我已经从构建中获得了源代码和 .PDB 文件,因此我应该能够使用它们,但我无法弄清楚 Win 7 在哪里存储崩溃数据。事件查看器显示崩溃,但没有任何数据,并且目录 C:\Windows\Minidump 不存在。
崩溃文件放在哪里?
I have a Visual Basic 6 application that I've recently changed to use a couple of C++ DLLs I've written in Visual Studio 2008. The application works fine on my PC, but when we install it on one of our test PCs it tends to crash during shutdown - we see the Win 7 message "Your application has failed" or whatever it is.
I know Win 7 stores data that can be used to analyse the crash. I've got the source code and .PDB files from the build so I should be able to use that, but I can't figure out where Win 7 stores the data from the crash. The Event Viewer shows the crash but doesn't have any data and the directory C:\Windows\Minidump doesn't exist.
Where do the crash files get put?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Microsoft 在此提供了可追溯到 Vista Service Pack 1 的文档:
https://msdn.microsoft .com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx
有一个注册表项,其中包含 4 个控制一般崩溃的子值:
一旦这些注册表值到位,就会崩溃无论可能显示的任何对话框发生什么情况,都应立即写入文件。
注意: 具有可执行文件名称的注册表子项可用于仅控制一个指定进程的崩溃行为。
Microsoft has documentation here which works back to Vista Service Pack 1:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx
There is a registry key with 4 sub-values that control generic crashes:
Once these registry values are in place crash files should be immediately written no matter what happens to whatever dialog might be displayed.
Note: Registry sub-keys with executable name can be used to control crash behavior for only one specified process.
获取 WDK、使用 Windows 调试工具
使用命令 !analyze
!analyze 扩展显示有关当前异常或错误检查的信息。
了解有关窗口调试的更多信息
创建转储:
您可以通过在运行中给出命令“windbg -I”将windbg 配置为默认调试工具。
Dr. Watson 工具也可以为您做到这一点。
Get WDK , Using Debugging Tools for Windows
Use Windbg to open crash dump
use command !analyze
The !analyze extension displays information about the current exception or bug check.
Read more about window debugging
Creating Dump:
You can configure windbg as defaut debugging tool by giving command "windbg -I" in run.
Also Dr. Watson tool can do this for you.
您甚至可以使用 carsh 报告机制并获取本地保存的转储文件,然后使用 Visual Studio 对其进行调试。 Visual C++ 中有很多免费资源,但 VB 中则不多。
You can even use a carsh reporting mechanism and get the locally saved dump file, then debug it using Visual Studio. There are pretty much freely available resources in Visual C++, but not much in VB.
当崩溃发生时,为什么不让你的程序将小型转储保存在你想要的任何地方?我不熟悉 VB,但尝试使用
SetUnhandledExceptionFilter()
和MiniDumpWriteDump()
。Why don't you make your program save minidump wherever you want when the crash happens? I'm not familiar with VB, but try to use
SetUnhandledExceptionFilter()
andMiniDumpWriteDump()
.