Closed Uplink03 closed 6 years ago
go-debug just passes the buildFlags
as --build-flags=...
to delve.
Delve also uses a string
for build flags:
https://github.com/derekparker/delve/blob/678576d2ce3b14f7b6b59692669b8acbd7c427ff/cmd/dlv/cmds/commands.go#L93
Here is the documentation for it: https://github.com/derekparker/delve/blob/678576d2ce3b14f7b6b59692669b8acbd7c427ff/Documentation/usage/dlv.md#options
OK, so now my config looks like this:
"buildFlags": "-gcflags='-N -l'"
and it seems to like it.
I thought that would help with stepping through code, but didn't. When I "step over" through code the current line jumps all over the place.
Typically you don't need to provide any additional build flags because delve does that for you.
This is very often not a problem with go-debug but with delve itself.
Try running delve from the command line using dlv debug
or dlv test
.
As I said typically it is not required to pass custom build flags.
If you still think that this is an issue, try to debug your code from the command line using the dlv
executable. Also try updating dlv
using go get -u github.com/derekparker/delve/cmd/dlv
.
I would like to use the following build flag:
Is there a way to add my flags to buildFlags to the configuration file as it is?
The
buildFlags
field is a string. I would expect it to be an array similar toargs
.