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

     1  # Using Delve
     2  
     3  You can invoke Delve in [multiple ways](dlv.md), depending on your usage needs. Delve makes every attempt to be user-friendly, ensuring the user has to do the least amount of work possible to begin debugging their program.
     4  
     5  The [available commands](dlv.md) can be grouped into the following categories:
     6  
     7  *  Specify target and start debugging with the default [terminal interface](../cli/README.md):
     8     * [dlv debug [package]](dlv_debug.md)
     9     * [dlv test [package]](dlv_test.md)
    10     * [dlv exec \<exe\>](dlv_exec.md)
    11     * [dlv attach \<pid\>](dlv_attach.md)
    12     * [dlv core \<exe\> \<core\>](dlv_core.md)
    13     * [dlv replay \<rr trace\> ](dlv_replay.md)
    14  * Trace target program execution
    15     * [dlv trace [package] \<regexp\>](dlv_trace.md)
    16  * Start a headless backend server only and connect with an external [frontend client](../EditorIntegration.md):
    17     * [dlv **--headless** \<command\> \<target\> \<args\> ](../api/ClientHowto.md#spawning-the-backend)
    18        * starts a server, enters a debug session for the specified target and waits to accept a client connection over JSON-RPC or DAP
    19        * `<command>` can be any of `debug`, `test`, `exec`, `attach`, `core` or `replay`
    20        * if `--headless` flag is not specified the default [terminal client](../cli/README.md) will be automatically started instead
    21        * compatible with [dlv connect](dlv_connect.md), [VS Code Go](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#remote-debugging), [GoLand](https://www.jetbrains.com/help/go/attach-to-running-go-processes-with-debugger.html#attach-to-a-process-on-a-remote-machine)
    22     * [dlv dap](dlv_dap.md)
    23        * starts a DAP-only server and waits for a DAP client connection to specify the target and arguments
    24        * compatible with [VS Code Go](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#remote-debugging)
    25        * NOT compatible with [dlv connect](dlv_connect.md), [GoLand](https://www.jetbrains.com/help/go/attach-to-running-go-processes-with-debugger.html#attach-to-a-process-on-a-remote-machine)
    26     * [dlv connect \<addr\>](dlv_connect.md)
    27        * starts a [terminal interface client](../cli/README.md) and connects it to a running headless server over JSON-RPC
    28  * Help information
    29     * [dlv help [command]](dlv.md)
    30     * [dlv log](dlv_log.md)
    31     * [dlv backend](dlv_backend.md)
    32     * [dlv redirect](dlv_redirect.md)
    33     * [dlv version](dlv_version.md)
    34  
    35  The above list may be incomplete. Refer to the auto-generated [complete usage document](dlv.md) to further explore all available commands.
    36  
    37  ## Environment variables
    38  
    39  Delve also reads the following environment variables:
    40  
    41  * `$DELVE_EDITOR` is used by the `edit` command (if it isn't set the `$EDITOR` variable is used instead)
    42  * `$DELVE_PAGER` is used by commands that emit large output (if it isn't set the `$PAGER` variable is used instead, if neither is set `more` is used)
    43  * `$TERM` is used to decide whether or not ANSI escape codes should be used for colorized output
    44  * `$DELVE_DEBUGSERVER_PATH` is used to locate the debugserver executable on macOS