From f09896a593c044b4c23acb2eeceb6a4661d862ef Mon Sep 17 00:00:00 2001 From: polinasok <51177946+polinasok@users.noreply.github.com> Date: Thu, 6 Jan 2022 08:57:12 -0800 Subject: [PATCH] Documentation: add overview usage info for all dlv commands (#2857) * Documentation: add overview usage info for all dlv commands * Separate trace, adjust headless wording * Add headless command note Co-authored-by: Polina Sokolova --- Documentation/usage/README.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Documentation/usage/README.md b/Documentation/usage/README.md index 3bc7c5b0..851fda7b 100644 --- a/Documentation/usage/README.md +++ b/Documentation/usage/README.md @@ -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 \](dlv_exec.md) + * [dlv attach \](dlv_attach.md) + * [dlv core \ \](dlv_core.md) + * [dlv replay \ ](dlv_replay.md) +* Trace target program execution + * [dlv trace [package] \](dlv_trace.md) +* Start a headless backend server only and connect with an external [frontend client](../EditorIntegration.md): + * [dlv **--headless** \ \ \ ](../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 + * `` 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 \](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.