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

相关推荐
刘媚-海外12 分钟前
Go语言开发AI应用
开发语言·人工智能·golang·go
deepwater_zone43 分钟前
Go语言核心技术
后端·golang
二哈不在线3 小时前
代码随想录二刷之“动态规划”~GO
算法·golang·动态规划
AD钙奶-lalala4 小时前
Spring Initializr(或者 IDEA 里新建 Spring Boot 项目)时 Dependencies 的选择
spring boot·spring·intellij-idea
小玉起起4 小时前
IntelliJ IDEA 2025.1 Java Stream Debugger 快速使用指南
java·intellij-idea·idea
kaili2305 小时前
IDEA试用过期,无法登录,重置方法
java·intellij-idea
qq_172805597 小时前
Go 语言 PDF 生成库综合比较与实践指南
开发语言·golang·pdf
Sally璐璐11 小时前
Go组合式继承:灵活替代方案
开发语言·后端·golang
gou1234123411 小时前
Go语言io.Copy深度解析:高效数据复制的终极指南
开发语言·golang·php
帧栈12 小时前
开发避坑指南(47):IDEA 2025.1.3 运行main函数报错:CreateProcess error=206, 文件名或扩展名太长的解决方案
intellij-idea