WeiAnHsieh
WeiAnHsieh

Reputation: 125

separate debug info from go binary after the file has been built

I know that go build ldflags="-s -w" would work. However, I cannot optain a .debug file or debug info archive. Is there any method to strip binary generated from go build command only?

I've tried eu-strip but the sizes of files are not the same.

There are some other combination I've tried.

I noticed that the size of files that are built with "-s" or "-w" tags and stripped are very close to the one that is built with "-s -w" tags. Their sizes are still different though. Maybe eu-strip is not a suitable tool.

How can I separate debug information from non-stripped binary? I want to use such file to debug with dlv.

(ref of debug-info-directory: https://github.com/go-delve/delve/blob/master/pkg/config/config.go)

Upvotes: 0

Views: 143

Answers (0)

Related Questions