整个是一个docker环境: 1.12.1,镜像是我自己做的.

操作系统版本: Ubuntu 14.04.5 LTS

go版本: 1.6.3


gdb中执行run命令出错!

 

错误输出:

warning:Error disabling address space randomization: Operation not permitted

环境:docker

 

解决办法:

warning:Error disabling address space randomization: Operation not permitted

 

结论:

When running within a dockercontainer, I got this error until I added--security-optseccomp=unconfined to the dockerrun. – Cameron Taggart Jun 7 at 4:28

 

来自 <http://stackoverflow.com/questions/35860527/warning-error-disabling-address-space-randomization-operation-not-permitted>

 

 

info goroutines: Undefined info command:“goroutines”

错误输出:

(gdb)info goroutines

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

 

相关资料:

Undefinedinfo command: “goroutines”

Debugging Go Code with GDB

Text filesrc/runtime/runtime-gdb.py

 

结论:

使用GDB调试GO程序

http://www.cnblogs.com/guxuanqing/p/5638363.html

建立~/.gdbinit

add-auto-load-safe-path/usr/local/go/src/runtime/runtime-gdb.py                                                                          

setauto-load safe-path /                                                          

pythonsys.path.append("/usr/share/gdb/python")

 

/usr/local/go/src/runtime/runtime-gdb.py里面的gdb怎么搞出来的?

goobjfile= gdb.current_objfile() or gdb.objfiles()[0]

参看上个问题的结论

应该是把/usr/share/gdb/python里的东西加到sys.path里面去了