Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

godebug build not using generated package files #45

Open
xinhuang327 opened this issue Jun 19, 2015 · 1 comment
Open

godebug build not using generated package files #45

xinhuang327 opened this issue Jun 19, 2015 · 1 comment

Comments

@xinhuang327
Copy link

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!

@xinhuang327
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant