apply small fixes

This commit is contained in:
Milos Pejanovic 2023-01-30 17:26:08 +01:00
parent 3204a684e4
commit 67abfeb6bb
2 changed files with 5 additions and 5 deletions

View File

@ -41,9 +41,8 @@ func (g Grapple) Attach(namespace, deployment, container, bin, arch, host string
}
func attachCmd(dlvPath, binPid, host string, port int, debug bool) []string {
cmd := []string{dlvPath, "--headless", "attach", binPid,
"--continue", "--api-version=2", "--accept-multiclient",
fmt.Sprintf("--listen=%v:%v", host, port)}
cmd := []string{dlvPath, "--headless", "attach", binPid, "--api-version=2",
"--continue", "--accept-multiclient", fmt.Sprintf("--listen=%v:%v", host, port)}
if debug {
cmd = append(cmd, "--log", "--log-output=rpc,dap,debugger")
}

View File

@ -7,15 +7,16 @@
{
"name": "Connect to server",
"type": "go",
"debugAdapter": "dlv-dap", // `legacy` by default
"debugAdapter": "dlv-dap",
"request": "attach",
"mode": "remote",
"port": 2345,
"host": "127.0.0.1",
"substitutePath": [
// from is the local workspace root of the app were debugging
// to is the remote mapping of src files built into the running binary, the working directory where the binary was built
// to is the remote mapping of src files built into the running binary, the working directory where the binary was built (or where the .mod file is)
// note that the binary must not be built with -ldflags "-w -s" and -trimpath as these will strip these paths and remove derbug info
// optinally to have all vars available with debug use -gcflags="all=-N -l" when building the your app
{ "from": "${workspaceFolder}", "to": "/" },
]
},