dlv
Go programming language debugger
TLDR
Debug an executable
SYNOPSIS
dlv command [options] [args]
DESCRIPTION
dlv (Delve) is a debugger for the Go programming language. It provides source-level debugging with support for goroutines, breakpoints, variable inspection, and expression evaluation.
Delve understands Go's runtime, correctly handling goroutine scheduling, garbage collection, and other Go-specific features. It supports both local debugging and remote debugging through its headless mode.
The debugger integrates with editors and IDEs via the Debug Adapter Protocol (DAP), enabling graphical debugging in VS Code, GoLand, and other editors.
PARAMETERS
COMMAND
Operation: debug, exec, test, attach, connect, etc.debug [PACKAGE]
Build and debug Go package.exec BINARY
Debug prebuilt binary.test [PACKAGE]
Debug tests.attach PID
Attach to running process.connect ADDR
Connect to headless server.--headless
Run in headless mode.--listen ADDR
Listen address for headless mode.--help
Display help information.
CAVEATS
Requires Go binaries with debug info (default). Some optimizations may affect debugging. Attaching to processes needs appropriate permissions. Core dumps require compatible Go version.
HISTORY
Delve was created by Derek Parker and released in 2014. It was developed to provide Go developers with a debugger that understands Go's concurrency model and runtime, replacing GDB for most Go debugging tasks.
