File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 2626
2727base_link = "http://golang.iswbm.com/en/latest/"
2828readme_header = '''
29- 这是我的个人博客( [Go编程时光](http:/golang.iswbm.con /) ),主要写关于Go的一些思考总结。
29+ 这是我的个人博客( [Go编程时光](http:/golang.iswbm.com /) ),主要写关于Go的一些思考总结。
3030'''
3131readme_tooter = '''
3232---
Original file line number Diff line number Diff line change @@ -68,10 +68,14 @@ func main(){
6868}
6969```
7070
71- 然后执行 如下命令进行编译,里面有好多个参数,我还没去了解是什么意思, 有疑问的可以自行搜索引擎
71+ 然后执行 如下命令进行编译,里面有好多个参数,有疑问的可以自行搜索引擎
7272
7373``` shell
74+ # 关闭内联优化,方便调试
7475$ go build -gcflags " -N -l" demo.go
76+
77+ # 发布版本删除调试符号
78+ go build -ldflags “-s -w”
7579```
7680
7781最后使用 GDB 命令进入调试界面
@@ -123,7 +127,7 @@ Breakpoint 1, main.main () at /home/wangbm/code/demo.go:5
123127- ` info locals ` :查看局部变量
124128- ` info args ` :查看函数的参数值及要返回的变量值
125129- ` info frame ` :堆栈帧信息
126- - ` info goroutines ` :查看 goroutines 信息。在使用前 ,需要注意先执行 /usr/local/go/src/runtime/runtime-gdb.py
130+ - ` info goroutines ` :查看 goroutines 信息。在使用前 ,需要注意先执行 source /usr/local/go/src/runtime/runtime-gdb.py
127131
128132- ` goroutine 1 bt ` :查看指定序号的 goroutine 调用堆栈
129133- 回车:重复执行上一次操作
@@ -193,4 +197,11 @@ regexp.input: struct regexp.inputBytes *
193197
194198
195199
200+ ** 参考文章**
201+
202+ - [ go 官方对于 gdb 的使用说明] ( https://golang.org/doc/gdb )
203+ - [ Mac 调试 golang 程序] ( [https://www.do1618.com/archives/771/mac-gdb-%E8%B0%83%E8%AF%95-golang-%E7%A8%8B%E5%BA%8F/](https://www.do1618.com/archives/771/mac-gdb-调试-golang-程序/) )
204+
205+
206+
196207![ ] ( http://image.python-online.cn/image-20200320125724880.png )
Original file line number Diff line number Diff line change @@ -40,4 +40,8 @@ https://learnku.com/docs/the-way-to-go
4040
41419、Go语言圣经
4242
43- https://go.wuhaolin.cn/gopl/
43+ https://go.wuhaolin.cn/gopl/
44+
45+ 10、mojotv
46+
47+ https://mojotv.cn/404#Golang
You can’t perform that action at this time.
0 commit comments