在Linux里面使用gdb/delve工具来调试程序。
安装
Linux
1 | go get github.com/go-delve/delve/cmd/dlv |
vscode中的-workspace中配置一份调试选项:
1 | "configurations": [ |
使用vscode,安装连接到远程,工具栏里面选择“运行”-“安装附加调试器”
1 | Could not attach to pid 2956: this could be caused by a kernel security setting, try writing "0" to /proc/sys/kernel/yama/ptrace_scope |
参考
- [1] github-delv