Go language gdb Debug Step Pit

Source: Internet
Author: User

The whole is a docker environment

Docker version: 1.12.1, image is made by myself based on ubuntu:14.04.05.

Container OS version: Ubuntu 14.04.5 LTS

Go version: 1.6.3


in the gdb executed in Run Command Error !

Error Output :

Warning:error Disabling address space randomization:operation not permitted

Environment :d ocker

Solutions :

Warning:error Disabling address space randomization:operation not permitted

conclusion

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

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

Info goroutines:undefined Info command: "Goroutines"

Error Output :

(GDB) Info goroutines

Undefinedinfo command: "Goroutines". Try "Help Info".

Related information:

Https://golang.org/doc/gdb

Undefinedinfo command: "Goroutines"

Debugging Go Code with GDB

Text filesrc/runtime/runtime-gdb.py

Conclusion:

Use GDB Debug GO program

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

Establish ~/.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")

How did GdB get out of the/usr/local/go/src/runtime/runtime-gdb.py?

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

To see the conclusion of a question

It's supposed to be /usr/share/gdb/python Add the stuff to the Sys.path there it goes.


This article is from the "Cavalry Blog" blog, please be sure to keep this source http://3732370.blog.51cto.com/3722370/1885740

Go language gdb Debug Step Pit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.