Notes for TechEd Talk - TLA402 Hardcore Production Debugging of .NET Applications -------------------------------------------------- Where to get the tools: WinDbg, ADPlus google "debugging tools for windows" MDbg Sample google "MDbg Sample" Hawkeye google "Hawkeye .net" WinDbg .hh - Help g - Go (also F5) CTRL+Break - Break sxe clr - Stop on all CLR Exceptions sxi clr - Ignore CLR Exceptions .loadby sos mscorwks - Loads SOS (only after the CLR has been initialized) !help - Help for SOS !help - Detailed help for a single command !printexception - Print current exception information ~ - List threads (unmanaged) !threads - List threads (managed) ~s - switch to thread (unmanaged thread id!) !clrstack - Call stack !clrstack -a - Call stack with parameters and locals !dumpstack - Call stack managed/unmanaged mix !syncblk !dumpheap -stat -type - list instance count !dumpheap -type - list all instances !gcroot
- find all references to a certain instance !dumpobject
- dump an object's contents !dumparray
- dump the contents of an array bp ntdll!zwTerminateProcess - Breakpoint before process termination .dump /ma c:\dumps\test.dump - Create a full memory dump ("mini dump with all options") .dump /m c:\dumps\test.dump - Create a small memory dump (small mini dump, mainly only !clrstack) AdPlus (Auto Dump Plus) adplus.vbs -crash -pn - start ADPlus and wait for a crash MDbg help - list all commands ca ex - catch all exceptions g - go p - print locals w - "where" (Stack trace) lo gui - load the GUI extension (only in "MDbg Sample", not "MDbg SDK")