This document provides a cheat sheet for using the WinDbg debugger and SOS extension to examine both managed (.NET) and unmanaged code and environments. It lists commands for loading and using SOS, examining managed threads, call stacks, objects, and heap usage. It also covers basic debugger functions like attaching/detaching from processes, setting breakpoints, and viewing unmanaged threads and call stacks.
This document provides a cheat sheet for using the WinDbg debugger and SOS extension to examine both managed (.NET) and unmanaged code and environments. It lists commands for loading and using SOS, examining managed threads, call stacks, objects, and heap usage. It also covers basic debugger functions like attaching/detaching from processes, setting breakpoints, and viewing unmanaged threads and call stacks.
This document provides a cheat sheet for using the WinDbg debugger and SOS extension to examine both managed (.NET) and unmanaged code and environments. It lists commands for loading and using SOS, examining managed threads, call stacks, objects, and heap usage. It also covers basic debugger functions like attaching/detaching from processes, setting breakpoints, and viewing unmanaged threads and call stacks.
This document provides a cheat sheet for using the WinDbg debugger and SOS extension to examine both managed (.NET) and unmanaged code and environments. It lists commands for loading and using SOS, examining managed threads, call stacks, objects, and heap usage. It also covers basic debugger functions like attaching/detaching from processes, setting breakpoints, and viewing unmanaged threads and call stacks.
Attach to process F6 Load SOS for .NET 1.x .load clr10\sos Detach from a process .detach Load SOS for .NET 2.0 .loadby sos mscorwks Break debuggee execution Ctrl-Break Continue debuggee execution g Exit WinDbg q Examining the Managed Environment Clear the screen .cls Dump runtime type information !dumpruntimetypes View managed threads !threads View managed call stack !clrstack Getting Help View combined managed / unmanaged !dumpstack Debuggee commands ? callstack Debugger commands .help View function call arguments !clrstack –p Online help file .hh command View local variables !clrstack –l Help on extension on top of chain !help View object dump !do address Help on specific extension command !help command View array dump !da address View object size (including children) !objsize address View heap usage by type !dumpheap -stat Issuing Commands View heap usage filtered by type !dumpheap -type type Scroll through command history [up], [down], [enter] View GC roots of object instance !gcroot address Paste into command window [right-click] View managed sync blocks !syncblk View managed thinlocks (CLR 2.0) !dumpheap –thinlock View information on most recent !printexception exception Examining the Unmanaged Environment !bpmd module method Set a breakpoint List loaded modules with full path lmf List loaded modules with last modified lmt timestamp List unmanaged threads ~ Select active thread ~thread_id s View call stack k View thread CPU consumption !runaway Set a breakpoint bp Dump small memory image .dump path Dump large memory image .dump /ma path