This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a D language project using the dub package manager.
- Build:
dub build - Run:
dub -- [args](e.g.,dub -- --ver) - Unit tests:
dub test - Generate docs:
dub build --build=docs
Compiles with DMD, LDC, and GDC. CI tests all three on Linux; LDC on macOS/Windows.
Aliceserver is a debugger server that speaks DAP (Debug Adapter Protocol) and GDB/MI protocols, using Alicedbg as the debugging back-end. It is work-in-progress — many DAP and GDB/MI commands are not yet implemented.
The server uses an OOP model with three interface layers that compose together:
ITransport(source/transport.d) — data I/O abstraction (streams, sockets). Impl:StdioTransport.IAdapter(source/adapter.d) — protocol handler that parses requests from a transport and formats responses/events. Impls:DAPAdapter,MIAdapter.IDebugger(source/debugger.d) — debugger abstraction for process control. Impl:AliceDebugger(wraps Alicedbg).
The main loop in source/aliceserver.d (startServer) polls the transport for data, dispatches to the adapter, and forwards debugger events back through the adapter. The adapter selection (DAP vs MI) is set via CLI --adapter=dap|mi.
Entry point: source/main.d — CLI argument parsing, then calls startServer().
source/adapters/dap.d— DAP protocol implementationsource/adapters/mi.d— GDB/MI protocol implementationsource/debuggers/alicedbg.d— Alicedbg integrationsource/transports/stdio.d— stdio transportsource/util/— JSON helpers, shell utilities, formattingtestdap.d,testmi.d— interactive tester tools (spawn server as subprocess, send protocol messages)
testdap.d and testmi.d are D scripts (invoked with rdmd, gdmd -run, or ldmd2 -run)
meant to emulate a client interactively. They do not integrate a test framework, and thus
do not have automated integration tests.
- Module names match file paths (e.g.,
module adapters.dap→source/adapters/dap.d) - Dependencies are pinned by git commit hash in
dub.sdl(alicedbg, ddlogger) debug/elseblocks are used for debug-vs-release conditional compilation