Skip to content

Commit

Permalink
Documentation: add overview usage info for all dlv commands (go-delve…
Browse files Browse the repository at this point in the history
…#2857)

* Documentation: add overview usage info for all dlv commands

* Separate trace, adjust headless wording

* Add headless command note

Co-authored-by: Polina Sokolova <[email protected]>
  • Loading branch information
polinasok and polinasok authored Jan 6, 2022
1 parent 0ecdc6e commit f09896a
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions Documentation/usage/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Using Delve

You can invoke Delve in multiple ways, 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.
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.

Refer to the [main usage document](dlv.md) to further explore commands.
The [available commands](dlv.md) can be grouped into the following categories:

* Specify target and start debugging with the default [terminal interface](../cli/README.md):
* [dlv debug [package]](dlv_debug.md)
* [dlv test [package]](dlv_test.md)
* [dlv exec \<exe\>](dlv_exec.md)
* [dlv attach \<pid\>](dlv_attach.md)
* [dlv core \<exe\> \<core\>](dlv_core.md)
* [dlv replay \<rr trace\> ](dlv_replay.md)
* Trace target program execution
* [dlv trace [package] \<regexp\>](dlv_trace.md)
* Start a headless backend server only and connect with an external [frontend client](../EditorIntegration.md):
* [dlv **--headless** \<command\> \<target\> \<args\> ](../api/ClientHowto.md#spawning-the-backend)
* starts a server, enters a debug session for the specified target and waits to accept a client connection over JSON-RPC or DAP
* `<command>` can be any of `debug`, `test`, `exec`, `attach`, `core` or `replay`
* if `--headless` flag is not specified the default [terminal client](../cli/README.md) will be automatically started instead
* 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)
* [dlv dap](dlv_dap.md)
* starts a DAP-only server and waits for a DAP client connection to specify the target and arguments
* compatible with [VS Code Go](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#remote-debugging)
* 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)
* [dlv connect \<addr\>](dlv_connect.md)
* starts a [terminal interface client](../cli/README.md) and connects it to a running headless server over JSON-RPC
* Help information
* [dlv help [command]](dlv.md)
* [dlv log](dlv_log.md)
* [dlv backend](dlv_backend.md)
* [dlv redirect](dlv_redirect.md)
* [dlv version](dlv_version.md)

The above list may be incomplete. Refer to the auto-generated [complete usage document](dlv.md) to further explore all available commands.

0 comments on commit f09896a

Please sign in to comment.