2016-02-19 18:32:24 +00:00
## dlv exec
2016-05-20 17:51:23 +00:00
Execute a precompiled binary, and begin a debug session.
2016-02-19 18:32:24 +00:00
### Synopsis
2016-05-20 17:51:23 +00:00
Execute a precompiled binary and begin a debug session.
This command will cause Delve to exec the binary and immediately attach to it to
begin a new debug session. Please note that if the binary was not compiled with
optimizations disabled, it may be difficult to properly debug it. Please
2018-10-15 11:00:22 +00:00
consider compiling debugging binaries with -gcflags="all=-N -l" on Go 1.10
or later, -gcflags="-N -l" on earlier versions of Go.
2016-02-19 18:32:24 +00:00
```
2021-07-22 18:05:37 +00:00
dlv exec < path / to / binary > [flags]
2016-02-19 18:32:24 +00:00
```
2019-07-19 17:59:38 +00:00
### Options
```
2020-04-04 22:19:35 +00:00
--continue Continue the debugged process on start.
2021-07-22 18:05:37 +00:00
-h, --help help for exec
2020-04-04 22:19:35 +00:00
--tty string TTY to use for the target program
2019-07-19 17:59:38 +00:00
```
2016-02-19 18:32:24 +00:00
### Options inherited from parent commands
```
2022-01-06 16:57:40 +00:00
--accept-multiclient Allows a headless server to accept multiple client connections via JSON-RPC or DAP.
2020-08-21 14:14:02 +00:00
--allow-non-terminal-interactive Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
2022-01-06 16:57:40 +00:00
--api-version int Selects JSON-RPC API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
2020-08-21 14:14:02 +00:00
--backend string Backend selection (see 'dlv help backend'). (default "default")
2021-09-25 15:41:00 +00:00
--check-go-version Exits if the version of Go in use is not compatible (too old or too new) with the version of Delve. (default true)
2020-10-21 19:50:52 +00:00
--disable-aslr Disables address space randomization
2022-01-06 16:57:40 +00:00
--headless Run debug server only, in headless mode. Server will accept both JSON-RPC or DAP client connections.
2020-08-21 14:14:02 +00:00
--init string Init file, executed by the terminal client.
2024-02-07 19:04:45 +00:00
-l, --listen string Debugging server listen address. Prefix with 'unix:' to use a unix domain socket. (default "127.0.0.1:0")
2020-08-21 14:14:02 +00:00
--log Enable debugging server logging.
--log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
--log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
--only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
-r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
--wd string Working directory for running the program.
2016-02-19 18:32:24 +00:00
```
### SEE ALSO
2021-07-22 18:05:37 +00:00
2016-02-19 18:32:24 +00:00
* [dlv ](dlv.md ) - Delve is a debugger for the Go programming language.