From 737b4e81f958470a3d06b553621cbd42bbf227ef Mon Sep 17 00:00:00 2001 From: Asif Mohammad Mollah Date: Sun, 26 Jan 2025 04:48:39 +0400 Subject: [PATCH] dlv debugger added to makefile --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 25b4910..61a6863 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ uninstall: rm /usr/local/share/man/man1/telepath.1 build: - go build -ldflags="$(LDFLAGS)" -o telepath + go build -gcflags="all=-N -l" -ldflags="$(LDFLAGS)" -o telepath dist: cp man/telepath.1 man/telepath.old @@ -70,4 +70,19 @@ dist: clean: rm -rf telepath* - rm -rf build \ No newline at end of file + rm -rf build + +# For headless debugging +debug-srv-headless: build + dlv exec telepath --headless --listen=:2345 --api-version=2 -- daemon start --daemon-child + +# Will connect remote debugger +debug-connect: + dlv connect :2345 + +# Will debug daemon locally +debug: build + dlv exec telepath -- daemon start --daemon-child +# For client debugging you need to start similar command line this +# dlv exec telepath -- daemon status +# dlv exec telepath -- host list