有没有办法在崩溃时启动VS Debugger? [英] Is there a way to launch VS Debugger on crash?
问题描述
我有一个在自动测试设备上运行的程序。 在测试大约7个小时后,它会随机崩溃(由于malloc失败,堆栈转储显示)。 我在启用调试设置的情况下重新编译了程序。 有没有办法让调试器
拦截崩溃而不先附加调试器(因为附加调试器确实会降低执行速度)。 如果我附加调试器并且程序崩溃,调试器是否会拦截崩溃并将其视为断点?
I have a program that runs on automated test equipment. After about 7 hours into testing, it randomly crashes (stack dump shows due to malloc fail). I recompiled the program with debug settings enabled. Is there a way to have the debugger intercept the crash without attaching the debugger first (because attaching the debugger really slows down execution). If I do attach the debugger and the program crashes, will the debugger intercept the crash and treat it as a breakpoint?
推荐答案
我想你可以通过尝试try执行并在catch中调用调试器休息一下,在程序中将断点添加到顶层崩溃。
I guess you could add a breakpoint into your program crashing on top level by trying a try catch around the execution and calling the debugger in the catch for a break.
然后你应该能够在之后连接调试器7小时。
then you should be able to connect the debugger after the 7 hours.
另一种可能性是
UnhandledException事件。
这篇关于有没有办法在崩溃时启动VS Debugger?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!