goland idea中debug程序报错-debugger could not patch runtime.mallogc

idea中debug Go程序报错error layer=debugger could not patch runtime.mallogc

一、问题场景
在idea中配置了Go编程环境,可以运行Go程序,但是无法debug,报错error layer=debugger could not patch runtime.mallogc: no type entry found, use ‘types’ for a list of valid types

 

二、解决方案

这是由于idea中使用的dlv.exe版本太老导致,直接在终端中执行如下命令安装最新版dlv.exe

go install github.com/go-delve/delve/cmd/dlv@latest

 这会将dlv.exe安装到个人所设置的GOPATH目录下的bin目录中

 打开idea的Help->Edit Custom Properties,添加一下dlv.exe的路径,然后重启idea即可

 参考:https://blog.csdn.net/m0_56602092/article/details/135792320

posted @ 2024-09-02 14:45  努力乄小白  阅读(37)  评论(0编辑  收藏  举报