mailgun/godebug

godebug build not using generated package files

Opened this issue · 1 comments

Greetings, thank you for creating such an awesome tool for go developers. I have tried to use godebug to debug my project with many packages, I use following command to build:

godebug.exe build -instrument=github.com/..../cms/data

And then run the built binary but no breakpoint is activated.

Then I use -godebugwork to get generated go files, copy all the generated package files to origin directory, and use normal go build/run, I can then successfully enter the breakpoint and print vars etc...

I wonder why godebug build didn't use its generated files to build the executable, whether it's a bug or what did I do wong?

Thank you!

I looked into the source code and found this may be Windows platform specific. setGopath to tmpDir in cmd.go seems have no effect on go build, go tool still build with original GOPATH.

So I tweaked the code a little bit and resolve the issue: rename those package directory names before second build, and restore after build. (Changes in fork: xinhuang327@26d0353)

This is just my nasty try, this issue still need further investigation and improvement.