现象
在一些init
函数中打下断点,执行时达到断点后,Debug Console
输出一下信息后会直接结束,无法继续进行调试
Unhandled error in debug adapter: TypeError: Cannot read properties of undefined (reading 'addr')
at GoDebugSession.convertDebugVariableToProtocolVariable (/root/.vscode-server/extensions/golang.go-0.37.1/dist/debugAdapter.js:16728:25)
at /root/.vscode-server/extensions/golang.go-0.37.1/dist/debugAdapter.js:16249:55
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 2)
修复方案
根据找到vscode golang插件源码,ignore undefined的情况:
目前已通过PR
合入vscode
主干,将在0.38.0
正式发布