CLR Debugging

mac2022-06-30  19

1. CLR Process

Source code -> Compiler -> .NET Assembly -> CLR JITApplication domains (System, Shared, Default)Assemblies (Private, Shared) (logical constructs)Modules (physical constructs)Types (Fundamental unit of programmability) (Value types, Reference types)Method Tables (Also known as a type handle, Contains information that describes the type)Method Descriptors Additional information that completes the descriptive nature of typesType handle contains basic information about method on the typeMethod descriptor augments that information (JIT status, Address of JIT’ed code)

Ref : http://msdn.microsoft.com/en-us/magazine/cc163791.aspx

2. Debugger Extensions

SOS (Son of Strike)SOSEX (3rd party extension, http://www.stevestechspot.com/)PSSCOR2/PSSCOR4

3. Debugger Command Categories

Object inspection !DumpObject : Dumps a single reference object!DumpArray: Dumps an array object!GCRoot: Dumps the reference chain of an object!mdv : Displays local variables!strings: Dump out all the strings!threads: shows the last exception thrown on any given thread!PrintException : shows the exception information of the specified exceptionCode and Threads !U : Disassembles the code at the specific address!IP2MD: Returns the method descriptor for the given code address!threads : Displays all managed threads in the process!ClrStack : Displays the managed call stack of the current thread~*e!ClrStack: Displays all managed threads and their callstackDiagnostics !VerifyHeap : Validates managed heap integrity!GCHandles : Shows all handles in the process!GCHandleLeaks: Attempts to find leaked handles!VMStat: Virtual memory statisticsCLR data structures !DumpDomain: Dumps out the application domains!ThreadPool : Dumps out information on the CLR thread pool!DumpIL : Dumps the IL for the specified address

 4. Managed Debug Assistants

Similar to Application VerifierEnabled via the registry and config files (HKLM\Software\Microsoft\.NETFramework\MDA=“1”, <appname>.exe.dma.config)

SOS Cheat Sheet: http://blogs.msdn.com/b/alejacma/archive/2009/06/30/sos-cheat-sheet-net-2-0-3-0-3-5.aspx

转载于:https://www.cnblogs.com/Dennymei/archive/2013/01/30/2883204.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)