An open source, cross platform .NET debugger implementing the VS Code Debug Adapter Protocol (DAP), completely written in C#!
SharpDbg uses the ClrDebug managed wrapper around the ICorDebug APIs.
| SharpDbg | netcoredbg | |
|---|---|---|
| Implementation | C# | C++ with interop to C# where necessary |
| Cross Platform | ✅ | ✅ |
| Expression Evaluation | ✅ | ✅ |
| DebuggerBrowsable Support | ✅ | ✅ |
| DebuggerDisplay Support | ✅ | ❌ |
| DebuggerTypeProxy Support | ✅ | ❌ |
SharpDbg is actively developed, and some features are still being worked on:
- Stepping in async methods
- Source Link support
- Auto decompilation to source support
SharpDbg is organized into three main components:
┌─────────────────────────────────────────────────────────┐
│ VS Code / DAP Client │
└────────────────────────────┬────────────────────────────┘
│ DAP (stdin/stdout)
┌────────────────────────────▼────────────────────────────┐
│ SharpDbg.Cli │
│ • Entry point and command-line argument handling │
│ • DAP protocol client initialization │
└────────────────────────────┬────────────────────────────┘
│
┌────────────────────────────▼────────────────────────────┐
│ SharpDbg.Application │
│ • DAP protocol implementation │
│ • VS Code protocol message handlers │
│ • Event communication (stopped, continued, etc.) │
└────────────────────────────┬────────────────────────────┘
│
┌────────────────────────────▼────────────────────────────┐
│ SharpDbg.Infrastructure │
│ • Core debugger engine (ManagedDebugger) │
│ • ICorDebug API wrapper (ClrDebug) │
│ • Breakpoint and variable management │
│ • Expression evaluator (compiler + interpreter) │
└─────────────────────────────────────────────────────────┘
- Ensure .NET 10 SDK is installed
- git clone
dotnet build- Done!
This will produce the debug adapter executable at artifacts/bin/SharpDbg.Cli/Debug/net10.0/SharpDbg.Cli.exe, equivalent to netcoredbg.exe
[DebuggerDisplay("Count = {Count}")]
public class List<T> : IList<T>, IList, IReadOnlyList<T>DebuggerTypeProxy & DebuggerBrowsable(.RootHidden) attributes
[DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
public class List<T> : IList<T>, IList, IReadOnlyList<T>- ClrDebug - Managed wrappers around the ICorDebug API
- netcoredbg - .NET debugger, written in C++
- debug-adapter-protocol - Microsoft's VS Code Debug Adapter Protocol