gpt4 book ai didi

go - 未定义的信息命令 : "goroutines"

转载 作者:IT王子 更新时间:2023-10-29 02:05:45 25 4
gpt4 key购买 nike

我刚接触 golang。我正在调试我的 go 应用程序。

当我尝试运行“info goroutines”时,它抛出了:

Undefined info command: "goroutines".  
Try "help info

我在 gdb 配置中遗漏了什么?

最佳答案

文章“Debugging Go Code with GDB”确实提到:

(gdb) info goroutines

但仅在为给定二进制文件加载扩展脚本的上下文中。

The tool chain uses this to extend GDB with a handful of commands to inspect internals of the runtime code (such as goroutines) and to pretty print the built-in map, slice and channel types.

If you'd like to see how this works, or want to extend it, take a look at src/pkg/runtime/runtime-gdb.py in the Go source distribution.
It depends on some special magic types (hash<T,U>) and variables (runtime.m and runtime.g) that the linker (src/cmd/ld/dwarf.c) ensures are described in the DWARF code.

If you're interested in what the debugging information looks like, run 'objdump -W 6.out' and browse through the .debug_* sections.

因此请确保您的调试 session 在激活这些扩展的情况下运行。

关于go - 未定义的信息命令 : "goroutines",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26797527/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com