WinDbg Reminders
Features & shortcuts
Create: 3/2013 Last Updated: 6/22/2013
- Small overhead
- xcopy deployment
- Intergration with symbols servers
- Right click with selection = copy
- Right click without select = paster
- Ctrl+Break = abort
SOS
Create: 3/2013 Last Updated: 6/22/2013
- WinDbg extension
- 'Son of Strike'
- Ships with .NET Framework
- All commands start with !
- !Help
Commands
Create: 3/2013 Last Updated: 6/22/2013
- .sympath - shows symbols path
- .symfix - automatically figure out symbols path
- .reload - required after .symfix
- .loadby sos clr - doesn't work for Azure (remote in and grab sos.dll from Azure Box)
- .load dllpath - doesn't like double-quotes
- .lastevent - last thing that happened in dump
- .time - last system uptime, process uptime, etc.
- !runaway - usefule when crash was running @100% CPU. list threads + CPU usage. Expect GC + IO completeion to be near or at top
- ~ means thread
- ~threadID - select thread (set the context)
- k - stack dump currently selected thread
- !threads - list summary of threads. Dead thread: can ve point in time, can ve actual problem. Finalizer: The finalizer thread from GC.
- !special - list threads including GC threads
- !dumpobject memoryAddress - dump the .NET object at memoryAddress. Alias: !do
- !dumpmt -mt methodTable - lists all methods
- !dumpstackobject - dumps every object in every layer of the stack. Alias: !dso
- !printexception dumpAddress - helper for dumping exception objects
- !clrstack - dump the CLR stack (this is the managed equivalent of the '' command)
- !eeHeap -gc - one heap per call. ee == execution Engine == Original name of the CLR.
- !dumpheap -strings - Show every string in memory (e.g. passwords :-)). Includes dup count.
- !dumpheap -stat - Summarizes all objects n heap (count, size, MT). System.string immutability means string nearely alwyas shows up as the biggest hit / red herring.
- !dumpheap -type fullType.name - wide search (X also finds ListX, List<X>, XY, etc)
- !dumpheap -MT methodTableAddress - narrow search (by MT)
- !dumparray -details objectPointer - detailed array dump. Alias: !da
- !name2ee ddlName.dll TypeName<.i> - return data including MT
- !gcroot - why every object is kept in meomroy. Show hiearchy to root object. Then !do on that root object
- .prefer_dml 1 [0 = off] - enable hyperlinks in output that are equivalent to !do. Turning this on really slows WinDbg down
- .foreach(obj {!command -short) {.echo ${obj}; !do ${obj}} [short trims output to just object pointers]
- $$>a< filename args
- $$ in code = comment
- .dump -ma outputPath - creates a dump. Note you can't CLR debug a minidump
- ~* command - runs command on all threads
- ~*kb - more detailed stack
- !dumpil ilAddress - dumps the IL code at ilAddress
- !ObjSuze objectPointer - Size of object and everything it points to (recursive)
- .shell
- !lm - list modules
- !lmi pointer - list module information
- dd - dump data
- du - dump unicode