I am wondering if GoLand can use the dlv exec command for debugging.
The reason we need this is because we have a complicated build process with CGO, and it's impossible to create a run configuration that works.
Maybe attach to process could work, but it doesn't seem like a great solution.
VSCode has nice integration with dlv exec, but the IDE works too slow and buggy, I wish we could use GoLand.
Has anybody found a solution for this?
Thanks in advance.
You can use the same steps as in debugging a remote process.
Those steps are:
go build -gcflags="all=-N -l" -o myApp
and any other flags you might need for CGO/etc.dlv --listen=:2345 --headless=true --api-version=2 exec ./myApp
Run | Edit Configurations | + | Go Remote
and create a new run configuration that connects to localhost
on port 2345
(or any other port you specify in delve's --listen
flag.