Delve
$ dlv Community Med Riskdlv (Delve) is the purpose-built debugger for Go programs, goroutines, and tests, handling Go's runtime scheduler and DWARF metadata accurately. Interactive by default, it supports --headless --api-version=2 JSON-RPC and dlv dap modes for scripted/IDE automation.
brew install delve Go runtime-aware debugger tied to local Go builds and OS ptrace/mach APIs.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Interactive (dlv) prompt blocks by default, though --headless --api-version=2 and dlv dap provide structured JSON-RPC/DAP endpoints (not single-shot CLI JSON).
- Interactive REPL by default unless
--headlessordlv dapis used - Supports piped
--init <file>script execution
Local debugging with zero auth; --headless opens a TCP listener that must stay bound to 127.0.0.1 to prevent remote execution.
--listen=127.0.0.1:2345keeps debug RPC local
First-class macOS, Linux, and Windows support via brew install delve and go install.
- Official cross-platform Go binary
Essential for inspecting Go goroutines, channels, and core dumps (dlv core), though heavier than go test for routine checks.
- Goroutine-aware stack/variable inspection
Community-governed go-delve/delve project under MIT license, backed by Go IDE tooling.
- Official debugger integrated into VS Code Go and GoLand
Clear --help subcommands and Markdown docs in the GitHub repo.
- CLI and API docs in
Documentation/cli
Security, Auth & Guardrails
No credentials required; debugs local Go binaries, tests, and core dumps.
MIT open-source Go debugger; free.
# Delve (dlv) Agent Rules - Never run bare `dlv debug` or `dlv test` without `--headless` or piped stdin commands, as the `(dlv)` REPL blocks. - Bind `--headless` strictly to `127.0.0.1:<port>` so the debug server is never exposed to the network. - Prefer `gotestsum` or `go test -v` unless goroutine/stack inspection is explicitly required.
Agent-Ready Command Recipes
Safe Read-Only Queries
dlv version
Prints the installed Delve version and build info without compiling or launching a target.
dlv test ./pkg/auth --headless --listen=127.0.0.1:2345 --api-version=2 -- --test.run=TestToken
Compiles and launches a JSON-RPC v2 headless debug server bound to localhost for scripted DAP/RPC clients.
Strengths for Agents
- + Understands Go goroutines, interfaces, and runtime frames far better than
gdb/lldb. - +
--headless --api-version=2anddlv dapexpose structured debug protocols.
Caveats & Pitfalls
- ! Default
(dlv)REPL blocks headless agents; no one-shot JSON output mode on stdout. - ! Headless debug servers open a local TCP port and wait for client RPC commands.