Go-ethereum Debug Compilation

Source: Internet
Author: User

When you use Go-ethereum for development, you need to test and debug Geth, because the official default makefile compiled version is an optimized version, regardless of GDB,

or DLV Debugging tools, will appear inconvenient debugging, after their own sorting and groping, to achieve the Go-ethereum debug version of the compilation,

The summary steps are as follows:

0. Use of the official Makefile production environment:

Cd/path/to/go-ethereum

Make Geth

1. Export GO work environment environment variables: Export gobin=/path/to/go-ethereum/build/bin

Export Gopath=/path/to/go-ethereum/build/_workspace

2. Force recompilation

Go install-a-gcflags=all= '-n-l '-v./cmd/geth

3. Compile or download DLV, recommend the use of DLV debugging tools, compared to GDB, DLV for Golang have better support.

DLV exec Geth

Related Article

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.