VS 中使用SOS
出自
More on debugging with SOS.DLL - enter Visual Studio
http://mtaulty.com/blog/archive/2004/08/06/628.aspx
FIX: Unmanaged debugging not possible until you install Visual C++ .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;813134
//—-调试Managed application
1. 设置project的属性,把”Enable Unmanaged Debugging”设置为true
否则在load sos时vs会报错:
SOS not available while Managed only debugging.
To load SOS, enable unmanaged debugging in your project properties.
如果没有安装 vc++.net, 上面的设置并不会有效果,使用F5直接运行project, vs会报错
—————————
Microsoft Development Environment
—————————
Error while trying to run project: Unable to start debugging.
Unable to start program ‘D:\Work2006\CursorTest\bin\Debug\CursorTest.exe’.
Unmanaged debugging is not available.
尝试使用 ctrl+F5启动程序,并Attach 进程,SOS也不能加载,提示:
SOS not available while Managed only debugging.
To load SOS, enable unmanaged debugging in your project properties.
3. 在 Immediate window (Debug-> Windows -> Immediate)中输入 .load sos
在Immediate window中输入 immed 和 cmd 可在Immediate mode和Command mode之间切换
//—-调试 dump file
1. File 打开 dump file
2. Debug->Start 等待中断
3. 在Immediate window中输入 .load sos
常用命令
!EEVersion
!ProcInfo
!ClrStack
!Help <command>
!
