go下gdb走的坑:info goroutines 的使用

栏目: C · 发布时间: 6年前

内容简介:gdb原生支持golang的调试,但是像info goroutines此类有go特性的命令却无法使用,info goroutines,提示找不到Undefined info command: "goroutines". Try "help info".以下列出解决方案。

gdb原生支持golang的调试,但是像info goroutines此类有 go 特性的命令却无法使用,

info goroutines,提示找不到Undefined info command: "goroutines". Try "help info".

以下列出解决方案。

  • 首先找到go的安装路径
$ which go
/usr/local/go/bin/go

在go/bin/go之前的便是安装目录(我电脑为:/usr/local)

  • 加载runtime-gdb.py

    打开gdb,在运行程序之前输入:

(gdb) source /usr/local/go/src/runtime/runtime-gdb.py

运行help gdb下便可以看到:

info goroutines -- List all goroutines

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms in Python

Data Structures and Algorithms in Python

Michael T. Goodrich、Roberto Tamassia、Michael H. Goldwasser / John Wiley & Sons / 2013-7-5 / GBP 121.23

Based on the authors' market leading data structures books in Java and C++, this book offers a comprehensive, definitive introduction to data structures in Python by authoritative authors. Data Struct......一起来看看 《Data Structures and Algorithms in Python》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具