mirror of
https://github.com/foomo/gograpple.git
synced 2025-10-16 12:35:37 +00:00
apply small fixes
This commit is contained in:
parent
3204a684e4
commit
67abfeb6bb
@ -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 {
|
func attachCmd(dlvPath, binPid, host string, port int, debug bool) []string {
|
||||||
cmd := []string{dlvPath, "--headless", "attach", binPid,
|
cmd := []string{dlvPath, "--headless", "attach", binPid, "--api-version=2",
|
||||||
"--continue", "--api-version=2", "--accept-multiclient",
|
"--continue", "--accept-multiclient", fmt.Sprintf("--listen=%v:%v", host, port)}
|
||||||
fmt.Sprintf("--listen=%v:%v", host, port)}
|
|
||||||
if debug {
|
if debug {
|
||||||
cmd = append(cmd, "--log", "--log-output=rpc,dap,debugger")
|
cmd = append(cmd, "--log", "--log-output=rpc,dap,debugger")
|
||||||
}
|
}
|
||||||
|
|||||||
5
test/app/.vscode/launch.json
vendored
5
test/app/.vscode/launch.json
vendored
@ -7,15 +7,16 @@
|
|||||||
{
|
{
|
||||||
"name": "Connect to server",
|
"name": "Connect to server",
|
||||||
"type": "go",
|
"type": "go",
|
||||||
"debugAdapter": "dlv-dap", // `legacy` by default
|
"debugAdapter": "dlv-dap",
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"mode": "remote",
|
"mode": "remote",
|
||||||
"port": 2345,
|
"port": 2345,
|
||||||
"host": "127.0.0.1",
|
"host": "127.0.0.1",
|
||||||
"substitutePath": [
|
"substitutePath": [
|
||||||
// from is the local workspace root of the app were debugging
|
// 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
|
// 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": "/" },
|
{ "from": "${workspaceFolder}", "to": "/" },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user