mcpField
D
dotnet-debugging

dotnet-debugging

github.com/novotnyllcDevelopment234155 installsUpdated 2w ago
Repository

About dotnet-debugging

A debugging skill for investigating .NET and other native or mixed-mode applications on Windows, Linux, and macOS. It provides structured workflows for dumps, live processes, crashes, hangs, CPU spikes, memory issues, and container diagnostics.

Key features

  1. 01Crash dump and live-process workflows
  2. 02Crash, hang, and deadlock triage
  3. 03High-CPU and memory investigation
  4. 04Windows, Linux, and macOS guidance
  5. 05Docker and Kubernetes diagnostics
  6. 06Structured reports with stack evidence

Use cases

  1. 01Finding causes of a .NET crash or hang
  2. 02Investigating deadlocks and high CPU
  3. 03Tracing memory pressure or suspected leaks
  4. 04Diagnosing applications in containers

MCP support

The skill documents setup and access patterns for the WinDbg MCP server. It uses its tools to open remote debug sessions or dump files, run debugger commands, and close sessions.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/novotnyllc/dotnet-artisan --skill dotnet-debugging

After installing, type/dotnet-debuggingin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
references/
access-mcp.md
capture-playbooks.md
common-patterns.md
dump-workflow.md
linux-debugging.md
live-attach.md
mcp-setup.md
report-template.md
sanity-check.md
scenario-command-packs.md
symbols.md
task-crash.md
task-hang.md
task-high-cpu.md
task-kernel.md
task-memory.md
task-unknown.md

Details

From the project README

dotnet-debugging

Overview

Windows and Linux/macOS debugging using WinDbg MCP tools (Windows), dotnet-dump, and lldb with SOS (Linux/macOS). Applicable to any application -- native, managed (.NET/CLR), or mixed-mode. Includes container diagnostic patterns for Docker and Kubernetes. Guides investigation of crash dumps, application hangs, high CPU, and memory pressure through structured command packs and report templates.

Platforms: Windows (WinDbg MCP, cdb), Linux/macOS (dotnet-dump, lldb with SOS, createdump, dotnet-monitor).

Routing Table

TopicKeywordsDescriptionCompanion File
MCP setupMCP server, WinDbg, configurationMCP server configurationreferences/mcp-setup.md
MCP accessMCP access, tool IDs, dispatchMCP access patternsreferences/access-mcp.md
Common patternsdebug patterns, SOS, CLRCommon debugging patternsreferences/common-patterns.md
Dump workflowdump file, .dmp, crash dumpDump file analysis workflowreferences/dump-workflow.md
Live attachlive process, cdb, attachLive process attach guidereferences/live-attach.md
Symbolssymbol server, .symfix, PDBSymbol configurationreferences/symbols.md
Sanity checkverify, environment, baselineSanity check proceduresreferences/sanity-check.md
Scenario packscommand pack, triage, workflowScenario command packsreferences/scenario-command-packs.md
Capture playbookscapture, procdump, triggersCapture playbooksreferences/capture-playbooks.md
Report templatediagnostic report, evidenceDiagnostic report templatereferences/report-template.md
Crash triagecrash, exception, access violationCrash triagereferences/task-crash.md
Hang triagehang, deadlock, freezeHang triagereferences/task-hang.md
High-CPU triagehigh CPU, runaway thread, spinHigh-CPU triagereferences/task-high-cpu.md
Memory triagememory leak, heap, LOHMemory leak triagereferences/task-memory.md
Kernel debuggingkernel, BSOD, bugcheckKernel debuggingreferences/task-kernel.md
Unknown triageunknown issue, general triageUnknown issue triagereferences/task-unknown.md
Linux debuggingdotnet-dump, lldb, createdump, containerLinux/macOS debugging, dotnet-dump, lldb SOS, containersreferences/linux-debugging.md

Scope

  • Crash dump analysis (.dmp files) on Windows, Linux, and macOS
  • Live process attach (cdb on Windows, lldb on Linux/macOS)
  • Hang and deadlock diagnosis (thread analysis, lock detection, wait chains)
  • High CPU triage (runaway thread identification)
  • Memory pressure and leak investigation (managed heap, native heap)
  • Kernel dump triage (BSOD / bugcheck analysis, Windows)
  • Container diagnostics (dotnet-dump in Docker/Kubernetes, sidecar patterns)
  • Production diagnostics (dotnet-monitor REST API, trigger-based collection)
  • SOS commands across all platforms (WinDbg, dotnet-dump, lldb)
  • Structured diagnostic reports with stack evidence
Boundary with dotnet-tooling

Both skills use overlapping tools (dotnet-dump, dotnet-counters, dotnet-trace) but for different purposes:

ScenarioUse this skill (debugging)Use dotnet-tooling
Investigating a crash dump (.dmp)YesNo
"Why did my app crash/hang/OOM?"YesNo
Attaching a debugger to a live processYesNo
"How do I profile my app's performance?"NoYes (profiling)
"How do I reduce GC pressure?"NoYes (gc-memory)
Collecting a dump for later analysisYesNo
Running dotnet-counters to monitor metricsNoYes (profiling)
Analyzing a dump with dotnet-dumpYesNo
Decompiling an assembly to understand behaviorNoYes (ilspy-decompile)

Rule of thumb: if something is broken (crash, hang, deadlock, OOM), route here. If something is slow or needs optimization, route to dotnet-tooling.

Out of scope

  • Performance profiling (dotnet-counters, dotnet-trace for optimization) -> dotnet-tooling
  • GC tuning and managed memory optimization -> dotnet-tooling
  • Assembly decompilation (ILSpy) -> dotnet-tooling
  • Performance benchmarking and regression detection -> dotnet-testing
  • Application-level logging and observability -> dotnet-devops
  • Unit/integration test debugging -> dotnet-testing

MCP Tool Contract

These tool IDs are the WinDbg MCP server's exported names (single-underscore mcp_...), not the mcp__... dispatch prefix used by some hosts.

OperationPurpose
mcp_mcp-windbg_open_windbg_remoteAttach to a live debug server
mcp_mcp-windbg_open_windbg_dumpOpen a saved dump file
mcp_mcp-windbg_run_windbg_cmdExecute debugger commands
mcp_mcp-windbg_close_windbg_remoteDetach from live session
mcp_mcp-windbg_close_windbg_dumpClose dump session

Diagnostic Workflow

Preflight: Symbols

Before any analysis, configure symbols to get meaningful stacks:

  1. Set Microsoft symbol server: .symfix (sets srv* to Microsoft public symbols)
  2. Add application symbols: .sympath+ C:\path\to\your\pdbs
  3. Reload modules: .reload /f
  4. Verify: lm (list modules -- check for "deferred" vs "loaded" status)

Without correct symbols, stacks show raw addresses instead of function names.

Crash Dump Analysis
  1. Open dump: mcp_mcp-windbg_open_windbg_dump with dump file path
  2. Load SOS for managed code: .loadby sos clr (Framework) or .loadby sos coreclr (.NET Core)
  3. Get exception context: !pe (print exception), !analyze -v (automatic analysis)
  4. Inspect threads: ~*e !clrstack (all managed stacks), !threads (thread list)
  5. Check managed heap: !dumpheap -stat (heap summary), !gcroot <addr> (object roots)
Hang / Deadlock Diagnosis
  1. Attach or open dump, load SOS
  2. List all threads: !threads, identify waiting threads with !syncblk (sync block table)
  3. Detect deadlocks: !dlk (SOS deadlock detection)
  4. Inspect thread stacks: ~Ns !clrstack for specific thread N
  5. Check wait reasons: !waitchain for COM/RPC chains, !mda for MDA diagnostics
High CPU Triage
  1. Attach to live process or collect multiple dumps 10-30 seconds apart
  2. Use !runaway to identify threads consuming the most CPU time
  3. Inspect hot thread stacks: ~Ns kb (native stack), ~Ns !clrstack (managed stack)
  4. Look for tight loops, blocked finalizer threads, or excessive GC
Memory Pressure Investigation
  1. Open dump, load SOS
  2. Managed heap: !dumpheap -stat (type statistics), !dumpheap -type <TypeName> (filter)
  3. Find leaked objects: !gcroot <address> (trace GC roots to pinned or static references)
  4. Native heap: !heap -s (heap summary), !heap -l (leak detection)
  5. LOH fragmentation: !eeheap -gc (GC heap segments)

Report Template

## Diagnostic Report

**Symptom:** [crash/hang/high-cpu/memory-leak]
**Process:** [name, PID, bitness]
**Dump type:** [full/mini/live-attach]

### Evidence
- Exception: [type and message, or N/A]
- Faulting thread: [ID, managed/native, stack summary]
- Key stacks: [condensed callstack with module!function]

### Root Cause
[Concise analysis backed by stack/heap evidence]

### Recommendations
[Numbered action items]

Guardrails

  • Do not claim certainty without callee-side evidence
  • Do not call it a deadlock unless lock/wait evidence supports it
  • Preserve user privacy: do not include secrets from environment blocks in reports

Cross-references: dotnet-tooling for .NET SDK diagnostic tools (references/profiling.md) and GC/memory tuning (references/gc-memory.md).

References

Comments

Markdown supported