LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

dlv

Go programming language debugger

TLDR

Debug an executable
$ dlv exec [./binary]
copy
Debug with arguments
$ dlv exec [./binary] -- [arg1] [arg2]
copy
Debug a Go package
$ dlv debug [package]
copy
Attach to process
$ dlv attach [pid]
copy
Debug a test
$ dlv test [package]
copy
Start headless server
$ dlv debug --headless --listen=:[2345]
copy
Connect to remote
$ dlv connect [localhost:2345]
copy

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.

INSTALL

sudo apt install delve
copy
sudo dnf install delve
copy
sudo pacman -S delve
copy
sudo apk add delve
copy
sudo zypper install delve
copy
brew install delve
copy
nix profile install nixpkgs#delve
copy

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.

SEE ALSO

go(1), gdb(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid