github.com/cnboonhan/delve@v0.0.0-20230908061759-363f2388c2fb/Documentation/usage/dlv_exec.md (about)

     1  ## dlv exec
     2  
     3  Execute a precompiled binary, and begin a debug session.
     4  
     5  ### Synopsis
     6  
     7  Execute a precompiled binary and begin a debug session.
     8  
     9  This command will cause Delve to exec the binary and immediately attach to it to
    10  begin a new debug session. Please note that if the binary was not compiled with
    11  optimizations disabled, it may be difficult to properly debug it. Please
    12  consider compiling debugging binaries with -gcflags="all=-N -l" on Go 1.10
    13  or later, -gcflags="-N -l" on earlier versions of Go.
    14  
    15  ```
    16  dlv exec <path/to/binary> [flags]
    17  ```
    18  
    19  ### Options
    20  
    21  ```
    22        --continue     Continue the debugged process on start.
    23    -h, --help         help for exec
    24        --tty string   TTY to use for the target program
    25  ```
    26  
    27  ### Options inherited from parent commands
    28  
    29  ```
    30        --accept-multiclient               Allows a headless server to accept multiple client connections via JSON-RPC or DAP.
    31        --allow-non-terminal-interactive   Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
    32        --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)
    33        --backend string                   Backend selection (see 'dlv help backend'). (default "default")
    34        --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)
    35        --disable-aslr                     Disables address space randomization
    36        --headless                         Run debug server only, in headless mode. Server will accept both JSON-RPC or DAP client connections.
    37        --init string                      Init file, executed by the terminal client.
    38    -l, --listen string                    Debugging server listen address. (default "127.0.0.1:0")
    39        --log                              Enable debugging server logging.
    40        --log-dest string                  Writes logs to the specified file or file descriptor (see 'dlv help log').
    41        --log-output string                Comma separated list of components that should produce debug output (see 'dlv help log')
    42        --only-same-user                   Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
    43    -r, --redirect stringArray             Specifies redirect rules for target process (see 'dlv help redirect')
    44        --wd string                        Working directory for running the program.
    45  ```
    46  
    47  ### SEE ALSO
    48  
    49  * [dlv](dlv.md)	 - Delve is a debugger for the Go programming language.
    50