I've built a test binary (that runs my go tests). Now I want to debug with delve. How do I get dlv to run the program?
Also, how do I set the command line arguments to be passed to the executable? (
https://github.com/derekparker/delve/issues/178)
What I tried:
$ go test -c -gcflags "-N -l" -v # outputs myprog.test
$ dlv ./myprog.test -test.v -test.run 046 # attempting to set the command line args
Type 'help' for list of commands.
(dlv) run
Command failed: command not available
(dlv) c
Command failed: debugger isn't running
(dlv) help
The following commands are available:
help - Prints the help message.
break|b - Set break point at the entry point of a function, or at a specific file/line. Example: break foo.go:13
continue|c - Run until breakpoint or program termination.
step|si - Single step through program.
next|n - Step over to next source line.
threads - Print out info for every traced thread.
thread|t - Switch to the specified thread.
clear - Deletes breakpoint.
clearall - Deletes all breakpoints.
goroutines - Print out info for every goroutine.
breakpoints|bp - Print out info for active breakpoints.
print|p - Evaluate a variable.
info - Provides info about args, funcs, locals, sources, or vars.
exit - Exit the debugger.
(dlv) step
Command failed: debugger isn't running
(dlv) ??? mystified