The following is a summary of tools and resources that you might be interested in after taking the .NET Debugging and/or C++ Debugging courses we offer at Sela.
[Shameless plug: If you haven’t taken these courses yet, I strongly suggest that you check them out. Between the two of them they have more than 20 hands-on debugging exercises which basically guarantee that you’re going to come out a WinDbg expert and be able to analyze dumps, solve problems in production, pinpoint memory leaks, and so on.]
First of all, the tools you are going to need. This is also a list of what I ask system administrators to install when giving these courses in a disconnected environment:
- Windows XP SP2 or later + symbols
- Visual Studio 2008 or Visual Studio 2010
- Visual C++ 2010 Redistributable (x86) + symbols
- .NET Framework 3.5 SP1 + symbols
- .NET Framework 4.0 + symbols
- Debugging Tools for Windows 32-bit
- Windows Support Tools
- Windows Resource Kit Tools
- Sysinternals Suite
- CLR Profiler 2.0
- Application Compatibility Toolkit 5.6
- Application Verifier 32-bit
- .NET Reflector
- SOSEX Debugging Extension
Now the resources you might find handy. I organized these by exercise, so that for each exercise there is at least one reference you might find useful:
- Setting up symbols
- Configuring symbols in a connected environment (KB)
- Obtaining Windows symbol packages
- How to verify symbols with symchk
- Diagnosing a managed exception
- Configuring automatic crash dumps
- Using !PrintException and !CLRStack
- Managed deadlock with Monitors
- Using !SyncBlk and SOSEX’s !dlk
- Analyzing Monitor-based deadlocks on 64-bit
- Another way to tell the sync object your thread waits for
- Managed memory leak with static event
- Diagnosing a memory leak using SOS’s !DumpHeap, CLR Profiler, and Hawkeye
- Inspecting a managed heap with !DumpHeap
- Diagnosing a memory leak caused by event handlers
- Managed memory leak with finalizer
- Unblock my finalizer
- Don’t blindly count on a finalizer
- File access problem with Process Monitor
- .NET file access in Process Monitor
- The case of the slow logons (Process Monitor)
- Application compatibility fix
- Creating a registry redirection (VirtualRegistry)
- Version lie shims
- Using the CorrectFilePaths shim
- Diagnosing assembly loading with Fusion Log Viewer
- Using fuslogvw to diagnose binding issues
- Assembly private bin path pitfall
- Finalization race condition
- Finalizer vs. application
- Reader-writer lock deadlock
- Implementing a RWL using a semaphore
- COM and STA memory leak
- Find the STA thread to which we’re switching from SendReceive2
- Find the STA thread to which we’re switching from GetToSTA
- Inspecting the OXIDEntry structure in GetToSTA
- Comparing out-of-memory exceptions
- Memory display tool for virtual memory and GC heap
- Unmanaged memory leak with UMDH
- How to use umdh to find memory leaks
- GetProcessHeap and _get_heap_handle
- Unmanaged deadlock with critical sections
- Exploring the internals of critical sections
- Using !cs vs. !locks (with case studies)
- Unmanaged heap corruption with Application Verifier
- Exploring heap-based buffer overflows
- Using pageheap.exe (KB)
- Unmanaged stack corruption
- Common stack analysis commands
- File leak with Process Monitor and handle tracing
- See handle open call stacks
- The oh.exe tool
- Invalid handle problems with handle tracing
- Use !htrace to detect an invalid handle reference and when it was closed
- Handle Application Verifier stops
- C++ runtime checks
- /RTC compiler switch
- Multi-object deadlock with WCT and local kernel debugging
- Vista Wait Chain Traversal
- WCT debugging extension (also on CodePlex)
- Diagnosing a C++ exception
- Decoding the parameters of a thrown C++ exception
- Exception-related commands
Finally, there’s my three year old list of debugging tools that could also be considered useful.
原文地址:http://blogs.microsoft.co.il/blogs/sasha/archive/2010/08/10/net-debugging-and-c-debugging-resources.aspx