From b6b9efe1cc45f104a0a8c85b2aa3afdcc7d69527 Mon Sep 17 00:00:00 2001 From: Zach Wasserman Date: Thu, 25 Mar 2021 16:29:00 -0700 Subject: [PATCH] Document delve debug process (#538) --- docs/3-Contribution/1-Building-Fleet.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/3-Contribution/1-Building-Fleet.md b/docs/3-Contribution/1-Building-Fleet.md index ba6738b035..34e02c5b67 100644 --- a/docs/3-Contribution/1-Building-Fleet.md +++ b/docs/3-Contribution/1-Building-Fleet.md @@ -6,7 +6,7 @@ - [Development infrastructure](#development-infrastructure) - [Starting the local development environment](#starting-the-local-development-environment) - [Running Fleet using Docker development infrastructure](#running-fleet-using-docker-development-infrastructure) -- [Setting up a Linux Development Environment](#setting-up-a-linux-development-environment) +- [Debugging with Delve debugger](#debugging-with-delve-debugger) ## Building the code @@ -145,3 +145,14 @@ If you're using the Google Chrome web browser, you have the option to always aut > Note: in Chrome version 88 there is a bug where you must first enable [chrome://flags/#temporary-unexpire-flags-m87](chrome://flags/#temporary-unexpire-flags-m87). The [chrome://flags/#allow-insecure-localhost](chrome://flags/#allow-insecure-localhost) flag will then be visible again. +## Debugging with Delve debugger + +The [Delve](https://github.com/go-delve/delve) Go debugger can be used for debugging the Fleet binary. + +Use the following command in place of `make` and `./build/fleet serve --dev`: + +``` +dlv debug --build-flags '-tags=full' ./cmd/fleet -- serve --dev +``` + +It is important to pass the `-tags=full` build flag, otherwise the server will not have access to the asset files.