下来咱们来经过Goland IDE来debug下golang编译器node
package main import "fmt" type st struct { name string age int } type St st var ( avg int32 = 123 tag string = "aaa" //ttt int64 ) const ( A = 111 B = 222 ) func Echo(t string, f interface{}) { fmt.Printf(t, f) } func init() { } func main() { a := [...]int{1, 2, 3} Echo("a:%+v", a) }
断点设置go/src/cmd/compile/internal/gc/noder.go:246行
运行至端点后鼠标浮于xtop
变量之上,点击+号浮框展现变量内容:
展开xtop变量观察语法树数组结构以下:
上图展现的是xtop[0]和xtop[2]及部分xtop[8]golang