使用SOS - 在Visual Studio中启用非托管代码调试来支持本机代码调试
2009-12-23 13:49
387 查看
【转】/article/4870535.html
SOS(Son of Strike)扩展调试器可以用来显示CLR数据结构的内容。SOS是作为.net framework的一部分安装的(SOS.dll),位于%windir%\Microsoft.NET\Framework\v*.*.****(版本号)\目录下。在使用SOS(加载SOS.dll)进行调试的步骤:
Step1 在Visual Studio中设置项目属性,以启动托管调试:Visual Studio打开要调试的项目,菜单->项目(Project)->Project属性->调试->启用非托管代码调试,如下图所示:
!help
-------------------------------------------------------------------------------
SOS is a debugger extension DLL designed to aid in the debugging of managed
programs. Functions are listed by category, then roughly in order of
importance. Shortcut names for popular functions are listed in parenthesis.
Type "!help <functionname>" for detailed info on that function.
Object Inspection Examining code and stacks
----------------------------- -----------------------------
DumpObj (do) Threads
DumpArray (da) CLRStack
DumpStackObjects (dso) IP2MD
DumpHeap U
DumpVC DumpStack
GCRoot EEStack
ObjSize GCInfo
FinalizeQueue EHInfo
PrintException (pe) COMState
TraverseHeap BPMD
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
DumpDomain VerifyHeap
EEHeap DumpLog
Name2EE FindAppDomain
SyncBlk SaveModule
DumpMT GCHandles
DumpClass GCHandleLeaks
DumpMD VMMap
Token2EE VMStat
EEVersion ProcInfo
DumpModule StopOnException (soe)
ThreadPool MinidumpMode DumpAssembly
DumpMethodSig
DumpRuntimeTypes Other
DumpSig -----------------------------
RCWCleanupList FAQ
DumpIL
安装VS2003时,也会安装SOS的帮助文档,位于目录Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers Guide\Samples\sos下;但VS2005中貌似没有安装该帮助文档,这里有更详细的文档http://msdn2.microsoft.com/en-us/library/ms954594.aspx...。我将这两份文档放在我的cnblogs上,可以从这里(http://files.cnblogs.com/happyhippy/sos.rar)下载。
SOS(Son of Strike)扩展调试器可以用来显示CLR数据结构的内容。SOS是作为.net framework的一部分安装的(SOS.dll),位于%windir%\Microsoft.NET\Framework\v*.*.****(版本号)\目录下。在使用SOS(加载SOS.dll)进行调试的步骤:
Step1 在Visual Studio中设置项目属性,以启动托管调试:Visual Studio打开要调试的项目,菜单->项目(Project)->Project属性->调试->启用非托管代码调试,如下图所示:
!help
-------------------------------------------------------------------------------
SOS is a debugger extension DLL designed to aid in the debugging of managed
programs. Functions are listed by category, then roughly in order of
importance. Shortcut names for popular functions are listed in parenthesis.
Type "!help <functionname>" for detailed info on that function.
Object Inspection Examining code and stacks
----------------------------- -----------------------------
DumpObj (do) Threads
DumpArray (da) CLRStack
DumpStackObjects (dso) IP2MD
DumpHeap U
DumpVC DumpStack
GCRoot EEStack
ObjSize GCInfo
FinalizeQueue EHInfo
PrintException (pe) COMState
TraverseHeap BPMD
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
DumpDomain VerifyHeap
EEHeap DumpLog
Name2EE FindAppDomain
SyncBlk SaveModule
DumpMT GCHandles
DumpClass GCHandleLeaks
DumpMD VMMap
Token2EE VMStat
EEVersion ProcInfo
DumpModule StopOnException (soe)
ThreadPool MinidumpMode DumpAssembly
DumpMethodSig
DumpRuntimeTypes Other
DumpSig -----------------------------
RCWCleanupList FAQ
DumpIL
安装VS2003时,也会安装SOS的帮助文档,位于目录Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers Guide\Samples\sos下;但VS2005中貌似没有安装该帮助文档,这里有更详细的文档http://msdn2.microsoft.com/en-us/library/ms954594.aspx...。我将这两份文档放在我的cnblogs上,可以从这里(http://files.cnblogs.com/happyhippy/sos.rar)下载。
相关文章推荐
- 使用SOS - 在Visual Studio中启用非托管代码调试来支持本机代码调试
- 使用SOS - 在Visual Studio中启用非托管代码调试来支持本机代码调试
- 扬长避短使用Windbg和Visual Studio高效调试调试你的代码
- visual studio code and unity||mac 下使用visual studio 调试unity代码
- visual studio code and unity||mac 下使用visual studio 调试unity代码
- 使用Visual Studio 2015调试Android平台Cocos2d-x游戏的C++代码
- 【caffe源码研究】番外篇:(1) 使用Visual Studio 调试caffe代码
- 扬长避短使用Windbg和Visual Studio高效调试调试你的代码
- Visual Studio中SQL SERVER CLR代码调试工具使用讲解
- 使用Visual Studio 开发、调试WCF入门-1-零代码开发、调试WCF服务器端。HelloWorld
- VS没办法调试,直接退出,报错:1. 使用调试生成配置或禁用调试选项“启用‘仅我的代码’”。。。
- 扬长避短使用Windbg和Visual Studio高效调试调试你的代码
- 使用Visual Studio 开发、调试WCF入门-1-零代码开发、调试WCF服务器端。HelloWorld
- 快速搭建php环境并使用phpstorm调试php代码
- 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- (转帖)使用OpenFileDialog对话框打开文本文件(写此代码的人应该是有一定功力的程序员,因为代码写的很规范,很容易阅读,很好理解,很好调试)
- 未启用当前数据库的 SQL Server Service Broker,因此查询通知不受支持。如果希望使用通知,请为此数据库启用 Service Broker。]
- .NET / Rotor源码研究3 – 调试Rotor托管代码的利器:WinDbg和SOS
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码研究3 – 调试Rotor托管代码的利器:WinDbg和SOS