崩溃生成转储
我的应用程序运行 3-4 天后偶尔会在客户计算机上崩溃。是否可以在应用程序启动时自动将应用程序附加到 ADplus 等调试器?这是为了在应用程序崩溃时生成转储文件。
My application crashes occasionally at customer machine after running for 3-4 days. Is it possible to attach the application to a debugger like ADplus automatically when the application starts? This is for generating the dump file whenever the application crashes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于您想使用 ADPlus,我假设仅 Windows 解决方案可以做到这一点。
在这种情况下,您可以安装事后调试器。一旦您的应用程序崩溃,它就会弹出。我通常使用windbg。
Since you want to use ADPlus I assume a windows only solution will do it.
In this case you could install a post mortem debugger. It will pop up as soon as your app crashes. I usually use windbg.
您可能需要查看
SetUnhandledExceptionFilter< /code>
函数。
You may want to look at the
SetUnhandledExceptionFilter
function.IMO 当进程启动时,您不必附加到调试器。当进程终止并设置位置时,Windows 会查找调试器 AeDebugRegistryKey
在 x86 计算机上,它是
\\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug
CDB
可以设置为事后调试器我会使用诸如 cdb -iaec ".dump /ma /u crashedapp.dmp;q" 之类的东西来在进程终止时获取内存转储。
如果操作系统是 Vista SP1+,则可以将注册表配置为使用 WER
IMO you wouldn't have to attach to the debugger when the process starts. Windows would look for a debugger when the process terminates and the location is set AeDebug RegistryKey
On x86 computer it is
\\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug
CDB
can be set as Postmortem debuggerI would have something like
cdb -iaec ".dump /ma /u crashedapp.dmp;q"
to get a memory dump when the process terminates.And if the OS is Vista SP1+ then registry can be configured to get a full memory dump using WER http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx