Is there a way that I can get a full crash dump when my application crashes suddenly?
当我的应用程序突然崩溃时,有没有办法可以获得完整的崩溃转储?
The problem is that I suspect that it's due to unmanaged code that kills the .net framework itself, and because of that, unless there's a debugger attached to the application at the moment of the crash, the application doesn't even gets a chance to handle the crash.
问题是我怀疑这是由于非托管代码杀死.net框架本身,并且因此,除非在崩溃时有一个调试器连接到应用程序,应用程序甚至没有机会处理崩溃。
I can't attach a debugger and wait, because the crash happens randomly and we have many installed locations, so I'm wondering if it's possible to do this without attaching a debugger.
我无法附加调试器并等待,因为崩溃是随机发生的,我们有许多已安装的位置,所以我想知道是否可以在不附加调试器的情况下执行此操作。
Edit: I'm aware of Microsoft Debugging SDK, and I also just found out about DebugDiag. I'd like to do this without having to attach to the application each time, as it's usually in the middle of a sale and I don't have time to attach the debugger and explore the stack trace. DebugDiag does seem to let me setup a rule for this, but it seems to only work on already running processes, rather than waiting for some process to launch.
编辑:我知道Microsoft Debugging SDK,我也刚刚发现了DebugDiag。我想这样做而不必每次都附加到应用程序,因为它通常在销售中间,我没有时间附加调试器并探索堆栈跟踪。 DebugDiag确实让我为此设置了一个规则,但它似乎只适用于已经运行的进程,而不是等待某个进程启动。
4 个解决方案
#2
0
debugdiag is fully scriptable. When I was having problems like this, we would have it scan for certain process names, and attach automatically.
debugdiag完全可编写脚本。当我遇到这样的问题时,我们会扫描某些进程名称,并自动附加。
#3
0
The best method is to edit the registry so that when crashes occur it invokes the appropriate application to generate the dump. So in your case I would get Dr. Watson to generate the crash dump.
最好的方法是编辑注册表,以便在发生崩溃时调用适当的应用程序来生成转储。所以在你的情况下,我会让Watson博士生成崩溃转储。
See link
Basically edit the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug
基本上编辑注册表项HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows NT \ CurrentVersion \ AeDebug
set values
Value Name = Auto
Type = String (REG_SZ)
Data Value = 1 or 0. (Default is 1)
Value Name = Debugger
Type = String (REG_SZ)
Data Value = drwtsn32 -p %ld -e %ld -g
This will invoke Dr. Watson at the point that your app crashes. See the link in this post for further details, note that you will need to set the Auto value to 0 if you want to not have Dr. Watson be invoked in future.
这会在您的应用程序崩溃时调用Dr. Watson。有关详细信息,请参阅此帖子中的链接,请注意,如果您希望以后不要调用Dr. Watson,则需要将Auto值设置为0。
#4
0
Create a General exception handler for your program. Inside the exception handler write a code to manually create a dump in the desired path.
为您的程序创建常规异常处理程序。在异常处理程序内部编写代码以在所需路径中手动创建转储。
This Link would help http://brakertech.com/howto-c-generate-dump-file-on-crash/
此链接将有助于http://brakertech.com/howto-c-generate-dump-file-on-crash/
#1
#2
0
debugdiag is fully scriptable. When I was having problems like this, we would have it scan for certain process names, and attach automatically.
debugdiag完全可编写脚本。当我遇到这样的问题时,我们会扫描某些进程名称,并自动附加。
#3
0
The best method is to edit the registry so that when crashes occur it invokes the appropriate application to generate the dump. So in your case I would get Dr. Watson to generate the crash dump.
最好的方法是编辑注册表,以便在发生崩溃时调用适当的应用程序来生成转储。所以在你的情况下,我会让Watson博士生成崩溃转储。
See link
Basically edit the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug
基本上编辑注册表项HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows NT \ CurrentVersion \ AeDebug
set values
Value Name = Auto
Type = String (REG_SZ)
Data Value = 1 or 0. (Default is 1)
Value Name = Debugger
Type = String (REG_SZ)
Data Value = drwtsn32 -p %ld -e %ld -g
This will invoke Dr. Watson at the point that your app crashes. See the link in this post for further details, note that you will need to set the Auto value to 0 if you want to not have Dr. Watson be invoked in future.
这会在您的应用程序崩溃时调用Dr. Watson。有关详细信息,请参阅此帖子中的链接,请注意,如果您希望以后不要调用Dr. Watson,则需要将Auto值设置为0。
#4
0
Create a General exception handler for your program. Inside the exception handler write a code to manually create a dump in the desired path.
为您的程序创建常规异常处理程序。在异常处理程序内部编写代码以在所需路径中手动创建转储。
This Link would help http://brakertech.com/howto-c-generate-dump-file-on-crash/
此链接将有助于http://brakertech.com/howto-c-generate-dump-file-on-crash/