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

bash 复制代码
go install github.com/go-delve/delve/cmd/dlv@latest

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

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


参考:https://stackoverflow.com/questions/75585793/version-of-delve-is-too-old-for-go-version-1-20-0-maximum-supported-version-1-1

相关推荐
背帆5 小时前
go的interface接口底层实现
开发语言·后端·golang
oneDay++7 小时前
# IntelliJ IDEA企业版高效配置指南:从主题到快捷键的终极优化
java·经验分享·intellij-idea·学习方法
Jasmin Tin Wei7 小时前
idea中的vcs不见了,如何解决
java·ide·intellij-idea
阑梦清川10 小时前
关于Go语言的开发环境的搭建
开发语言·后端·golang
言之。10 小时前
Makefile 在 Go 项目中的实践
开发语言·elasticsearch·golang
阿海打酱油14 小时前
idea经常卡顿解决办法
java·ide·intellij-idea
Clown9514 小时前
go-zero(十八)结合Elasticsearch实现高效数据检索
开发语言·elasticsearch·golang
专注_每天进步一点点20 小时前
idea 启动Springboot项目在编译阶段报错:java: OutOfMemoryError: insufficient memory
java·spring boot·intellij-idea
IsPrisoner1 天前
Go语言安装proto并且使用gRPC服务(2025最新WINDOWS系统)
开发语言·后端·golang