# codedriverepeat/netcoredbg architecture

> Architecture diagram of the GitHub repository codedriverepeat/netcoredbg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/codedriverepeat/netcoredbg
- Repository: https://github.com/codedriverepeat/netcoredbg

## Overview

NetCoreDbg is a .NET Core debugger that exposes both GDB/MI and VS Code’s Debug Adapter Protocol, as well as a command-line interface. The principal workflow starts with a user or IDE selecting a protocol; the executable dispatches to that interface, which mediates debugging operations such as breakpoints, stepping, evaluation, and variable inspection. The tree supports these domain areas, but most implementation files were not excerpted, so links among them are left unverified. The graph omits build and test infrastructure.

Main entry points: [`src/debugger/manageddebugger.cpp`](https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/manageddebugger.cpp) (Managed debugger), [`src/main.cpp`](https://github.com/codedriverepeat/netcoredbg/blob/master/src/main.cpp) (Executable dispatch), [`src/protocols/vscodeprotocol.cpp`](https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/vscodeprotocol.cpp) (VS Code protocol), [`src/protocols/cliprotocol.cpp`](https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/cliprotocol.cpp) (Command-line protocol)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Executable entry"]
  node_main["Executable dispatch<br/>[main.cpp]"]
end

subgraph group_interfaces["Debugger interfaces"]
  node_cli["Command-line protocol<br/>[cliprotocol.cpp]"]
  node_mi["GDB/MI protocol<br/>[miprotocol.cpp]"]
  node_vscode["VS Code protocol<br/>[vscodeprotocol.cpp]"]
  node_protocol_types["Debugger interfaces<br/>[idebugger.h]"]
end

subgraph group_engine["Debug operations"]
  node_debugger["Managed debugger"]
  node_breakpoints["Breakpoint handling<br/>[breakpoints.cpp]"]
  node_stepping["Stepping<br/>[steppers.cpp]"]
  node_evaluation["Expression evaluation<br/>[Evaluation.cs]"]
  node_variables["Frames and variables<br/>[variables.cpp]"]
  node_threads["Thread control<br/>[threads.cpp]"]
end

subgraph group_runtime["Runtime support"]
  node_metadata["Modules and symbols<br/>[modules.cpp]"]
  node_interop["Native interop"]
  node_managed_bridge["Managed bridge<br/>[interop.cpp]"]
  node_coreclr["CoreCLR definitions<br/>[cor.h]"]
end

subgraph group_shared["Shared utilities"]
  node_sources["Source storage<br/>[sourcestorage.cpp]"]
  node_strings["String utilities<br/>[string_view.h]"]
  node_lifetime["Resource lifetime<br/>[torelease.h]"]
end

node_user(("Debugger user"))
node_ide(("VS Code / GDB client"))

node_user -->|"starts"| node_main
node_ide -->|"selects protocol"| node_main
node_main -->|"dispatches to"| node_cli
node_main -->|"dispatches to"| node_mi
node_main -->|"dispatches to"| node_vscode
node_main -->|"uses"| node_debugger
node_main -->|"uses"| node_managed_bridge
node_cli -.->|"uses interface"| node_protocol_types
node_mi -.->|"uses interface"| node_protocol_types
node_vscode -.->|"uses interface"| node_protocol_types
node_mi -.->|"routes commands"| node_debugger
node_vscode -.->|"routes requests"| node_debugger
node_cli -.->|"routes commands"| node_debugger
node_debugger -.->|"manages"| node_breakpoints
node_debugger -.->|"coordinates"| node_stepping
node_debugger -.->|"delegates evaluation"| node_evaluation
node_debugger -.->|"serves inspection"| node_variables
node_debugger -.->|"controls"| node_threads
node_debugger -.->|"uses metadata"| node_metadata
node_debugger -.->|"supports interop"| node_interop
node_managed_bridge -.->|"bridges runtime"| node_coreclr
node_vscode -.->|"uses source storage"| node_sources

click node_main "https://github.com/codedriverepeat/netcoredbg/blob/master/src/main.cpp"
click node_cli "https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/cliprotocol.cpp"
click node_mi "https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/miprotocol.cpp"
click node_vscode "https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/vscodeprotocol.cpp"
click node_protocol_types "https://github.com/codedriverepeat/netcoredbg/blob/master/src/interfaces/idebugger.h"
click node_debugger "https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/manageddebugger.cpp"
click node_breakpoints "https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/breakpoints.cpp"
click node_stepping "https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/steppers.cpp"
click node_evaluation "https://github.com/codedriverepeat/netcoredbg/blob/master/src/managed/Evaluation.cs"
click node_variables "https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/variables.cpp"
click node_threads "https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/threads.cpp"
click node_metadata "https://github.com/codedriverepeat/netcoredbg/blob/master/src/metadata/modules.cpp"
click node_interop "https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/interop_debugging.cpp"
click node_managed_bridge "https://github.com/codedriverepeat/netcoredbg/blob/master/src/managed/interop.cpp"
click node_coreclr "https://github.com/codedriverepeat/netcoredbg/blob/master/src/coreclr/cor.h"
click node_sources "https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/sourcestorage.cpp"
click node_strings "https://github.com/codedriverepeat/netcoredbg/blob/master/src/utils/string_view.h"
click node_lifetime "https://github.com/codedriverepeat/netcoredbg/blob/master/src/utils/torelease.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_user,node_ide toneBlue
class node_cli,node_mi,node_vscode,node_protocol_types toneAmber
class node_debugger,node_breakpoints,node_stepping,node_evaluation,node_variables,node_threads toneMint
class node_metadata,node_interop,node_managed_bridge,node_coreclr toneRose
class node_sources,node_strings,node_lifetime toneIndigo
```

## Components

### Executable entry

- [Executable dispatch](https://github.com/codedriverepeat/netcoredbg/blob/master/src/main.cpp): `src/main.cpp`

### Debugger interfaces

- [Command-line protocol](https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/cliprotocol.cpp): `src/protocols/cliprotocol.cpp`
- [GDB/MI protocol](https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/miprotocol.cpp): `src/protocols/miprotocol.cpp`
- [VS Code protocol](https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/vscodeprotocol.cpp): `src/protocols/vscodeprotocol.cpp`
- [Debugger interfaces](https://github.com/codedriverepeat/netcoredbg/blob/master/src/interfaces/idebugger.h): `src/interfaces/idebugger.h`

### Debug operations

- [Managed debugger](https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/manageddebugger.cpp): `src/debugger/manageddebugger.cpp`
- [Breakpoint handling](https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/breakpoints.cpp): `src/debugger/breakpoints.cpp`
- [Stepping](https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/steppers.cpp): `src/debugger/steppers.cpp`
- [Expression evaluation](https://github.com/codedriverepeat/netcoredbg/blob/master/src/managed/Evaluation.cs): `src/managed/Evaluation.cs`
- [Frames and variables](https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/variables.cpp): `src/debugger/variables.cpp`
- [Thread control](https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/threads.cpp): `src/debugger/threads.cpp`

### Runtime support

- [Modules and symbols](https://github.com/codedriverepeat/netcoredbg/blob/master/src/metadata/modules.cpp): `src/metadata/modules.cpp`
- [Native interop](https://github.com/codedriverepeat/netcoredbg/blob/master/src/debugger/interop_debugging.cpp): `src/debugger/interop_debugging.cpp`
- [Managed bridge](https://github.com/codedriverepeat/netcoredbg/blob/master/src/managed/interop.cpp): `src/managed/interop.cpp`
- [CoreCLR definitions](https://github.com/codedriverepeat/netcoredbg/blob/master/src/coreclr/cor.h): `src/coreclr/cor.h`

### Shared utilities

- [Source storage](https://github.com/codedriverepeat/netcoredbg/blob/master/src/protocols/sourcestorage.cpp): `src/protocols/sourcestorage.cpp`
- [String utilities](https://github.com/codedriverepeat/netcoredbg/blob/master/src/utils/string_view.h): `src/utils/string_view.h`
- [Resource lifetime](https://github.com/codedriverepeat/netcoredbg/blob/master/src/utils/torelease.h): `src/utils/torelease.h`

### Other components

- **Debugger user**
- **VS Code / GDB client**

## Connections

- Debugger user → Executable dispatch: starts (evidence: `README.md`)
- VS Code / GDB client → Executable dispatch: selects protocol (evidence: `README.md`)
- Executable dispatch → Command-line protocol: dispatches to (evidence: `src/main.cpp`)
- Executable dispatch → GDB/MI protocol: dispatches to (evidence: `src/main.cpp`)
- Executable dispatch → VS Code protocol: dispatches to (evidence: `src/main.cpp`)
- Executable dispatch → Managed debugger: uses (evidence: `src/main.cpp`)
- Executable dispatch → Managed bridge: uses (evidence: `src/main.cpp`)
- Command-line protocol → Debugger interfaces: uses interface
- GDB/MI protocol → Debugger interfaces: uses interface
- VS Code protocol → Debugger interfaces: uses interface
- GDB/MI protocol → Managed debugger: routes commands
- VS Code protocol → Managed debugger: routes requests
- Command-line protocol → Managed debugger: routes commands
- Managed debugger → Breakpoint handling: manages
- Managed debugger → Stepping: coordinates
- Managed debugger → Expression evaluation: delegates evaluation
- Managed debugger → Frames and variables: serves inspection
- Managed debugger → Thread control: controls
- Managed debugger → Modules and symbols: uses metadata
- Managed debugger → Native interop: supports interop
- Managed bridge → CoreCLR definitions: bridges runtime
- VS Code protocol → Source storage: uses source storage
