2016-02-19 18:32:24 +00:00
## dlv attach
Attach to running process and begin debugging.
### Synopsis
2016-05-20 17:51:23 +00:00
Attach to an already running process and begin debugging it.
This command will cause Delve to take control of an already running process, and
begin a new debug session. When exiting the debug session you will have the
option to let the process continue or kill it.
2016-02-19 18:32:24 +00:00
```
2021-07-22 18:05:37 +00:00
dlv attach pid [executable] [flags]
2016-02-19 18:32:24 +00:00
```
2020-04-10 02:02:02 +00:00
### Options
```
2023-08-09 17:30:22 +00:00
--continue Continue the debugged process on start.
-h, --help help for attach
--waitfor string Wait for a process with a name beginning with this prefix
--waitfor-duration float Total time to wait for a process
--waitfor-interval float Interval between checks of the process list, in millisecond (default 1)
2020-04-10 02:02:02 +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)
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.
-l, --listen string Debugging server listen address. (default "127.0.0.1:0")
--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)
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.