自动化 VisualStudio 即时窗口
我正在尝试自动化打开托管应用程序的故障转储和检索堆栈跟踪的过程。 Windgb 有时可以工作,但让它加载正确版本的 sos.dll 是一场噩梦,除非处理转储的计算机实际上与发生转储的计算机相同。
另一方面,Visual Studio 可以简单地完成这项工作。我打开转储,转到立即窗口,然后输入
.load \\<machine where dump occured>\c\windows\microsoft.net\framework\v2.0.50727\sos.dll
!clrtsack
“一切正常”。
我可以在 Visual Studio 中编写此过程的脚本吗?如果没有,Visual Studio使用的后端调试器是否与windbg相同?
I'm trying to automate the process of opening crash dumps for managed applications and retrieving the stack trace. Windgb works sometimes, but getting it to load the correct version of sos.dll is a nightmare unless the machine processing the dump is practically identical to the machine where the dump occured.
Visual Studio, on the other hand, does the job simply. I open the dump, go to the immediate window, and type
.load \\<machine where dump occured>\c\windows\microsoft.net\framework\v2.0.50727\sos.dll
!clrtsack
And eveything works just fine.
Can I script this process in visual studio? If not, is there a back end debugger used by visual studio that is the same as windbg?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
.loadby
命令来代替将完整路径传递给.load
命令,以向 WinDbg 提供有关 DLL 应位于何处的提示。该命令接收两个参数:
SOS
)clr
,对于早期版本为mscorwks
)。例如:
Instead of passing the complete path to the
.load
command, you could use the.loadby
command instead, to give WinDbg a hint about where the DLL should be located.The command receives two arguments:
SOS
)clr
for .Net v4.0, ormscorwks
for earlier versions).For example: