Upload
demi
View
42
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Windbg + SOS: cannon & shotgun. you should include in your toolkit. Information. Windbg Not fancy but strong. SOS Son of strike. The Tools. SOS Windbg. Part of .NET. Part of Debugging Tools, Download. We already have IDE, why Windbg. We have not IDE in Product Env - PowerPoint PPT Presentation
Citation preview
WINDBG + SOS: CANNON &SHOTGUN
you should include in your toolkit
Information Windbg
Not fancy but strong
SOS Son of strike
The Tools SOS Windbg
Part of .NET
Part of Debugging Tools, Download
We already have IDE, why Windbg
We have not IDE in Product Env We have not source code in Product Env Do not use windbg if you have IDE and
source code
Debugging Open executable (Ctrl + E)
Before CLR boot strap Attach to process (F6)
.detach and qd will leave process running Open Crash dump (Ctrl + D)
Offline debugging
Dumps Task Manager
Vista or newer ADPlus ProcDump
ADPlus Vbs versus exe Crash dump
adplus -crash -pn w3wp.exe -o c:\crashdump
Hang dump adplus -hang -pn w3wp.exe -o c:\
crashdump
Task Manager
Useful Commands
Inspecting CLR !gcroot !finzlizequeue !eeheep !dumpdomain
Meta and code !name2ee !dumpmt !u
Inspecting data !dumpheap !dumpobject (!do) !objsize !dumparray
Inspecting threads !threads !syncblk Clrstack !runaway
Setting up the Windbg srv*c:\symbols*http://
msdl.microsoft.com/download/symbols .loadby sos mscorwks
3.5 and 2.0 loadby sos clr
4.0
Start from Dining Philosophers
Demo http://www.cnblogs.com/ivenxu/articles/2
020974.html
Conclusion !syncblk and !clrstack are the key to
dead lock
Crash
Demo http://www.cnblogs.com/ivenxu/articles/1
970562.html
Conclusion !printexception (!pe) is key to detect
exception ~*e!clrstack always work but time cost
Scripting .foreach (name {<loop command>})
{<command name} .foreach(myVariable {!dumpheap -min
85000 -short}){.echo myVariable;!do myVariable;.echo *************}
PowerDbg http://powerdbg.codeplex.com/
Q & A Thanks