Go 远程 Delve 调试缓慢问题
-
Tue, Aug 13, 2024
-
阅读时间 1 分钟
go install github.com/go-delve/delve/cmd/dlv@latest
export PATH=$PATH:$GOPATH/bin
dlv --listen :33333 --api-version=2 --headless --accept-multiclient --allow-non-terminal-interactive exec {program-to-run} -- {program-args}
{
"version": "0.2.0",
"configurations": [
{
"name": "remote-debug",
"type": "go",
"request": "attach",
"mode": "remote",
"host": "{address-to-remote-server}",
"port": 33333,
"debugAdapter": "dlv-dap", // 适配器
"substitutePath": [ // 源代码路径映射
{
"from":"${workspaceFolder}",
"to":"{remote-source-folder},
}
]
}
]
}
"debugAdapter": "dlv-dap"