Golang Debug -- gdb

Posted by hujin on March 4, 2021

获取源码并编译

1
2
3
4
5
git clone https://github.com/coredns/coredns.git
cd coredns
go build -gcflags "-N -l" coredns.go

yum install -y gdb

debug

1
2
3
gdb coredns
b coredns.go:11
run

参考

  • https://github.com/kubevirt/user-guide/pull/196/files/700980d5099b969c4fe2defb3773ec84e628a207
  • https://www.juniper.net/documentation/en_US/day-one-books/topics/concept/contrail-as-a-cni.html
  • https://www.juniper.net/documentation/en_US/contrail19/topics/concept/kubernetes-cni-contrail.html