-
Notifications
You must be signed in to change notification settings - Fork 775
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
debugAdapter: add go module name check #606
Conversation
This PR (HEAD: f826c3c) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Polina Sokolova: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from Quoc Truong: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from Hyang-Ah Hana Kim: Patch Set 2: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: c8f16c2) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Quoc Truong: Patch Set 4: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: 6eed521) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Hyang-Ah Hana Kim: Patch Set 5: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from kokoro: Patch Set 5: Kokoro presubmit build starting for golang/vscode-go/gcp_ubuntu/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from kokoro: Patch Set 5: TryBot-Result-1 Kokoro presubmit build finished with status: FAILURE Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from Hyang-Ah Hana Kim: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: 0465715) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Quoc Truong: Patch Set 5: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from Quoc Truong: Patch Set 6: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from kokoro: Patch Set 6: Kokoro presubmit build starting for golang/vscode-go/gcp_ubuntu/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from kokoro: Patch Set 6: TryBot-Result+1 Kokoro presubmit build finished with status: SUCCESS Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from Hyang-Ah Hana Kim: Patch Set 6: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: 8c1c02d) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Quoc Truong: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: 74c6271) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Hyang-Ah Hana Kim: Patch Set 8: Run-TryBot+1 Code-Review+1 Trust+1 (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from kokoro: Patch Set 8: Kokoro presubmit build starting for golang/vscode-go/gcp_ubuntu/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from kokoro: Patch Set 8: TryBot-Result-1 Kokoro presubmit build finished with status: FAILURE Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: fa00948) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Quoc Truong: Patch Set 8: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from Polina Sokolova: Patch Set 9: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Message from Polina Sokolova: Patch Set 9: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: c1ec06b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Quoc Truong: Patch Set 9: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
This PR (HEAD: a533c89) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/vscode-go/+/253038 to see it. Tip: You can toggle comments from me using the |
Message from Polina Sokolova: Patch Set 11: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/253038. |
Thanks @quoctruong - I am currently cleaning up obsolete PRs. |
This change modifies the extension to check for the go module name matching before setting a breakpoint. The bug this is trying to address (summed up by @hyangah):
In the go-guestbook sample, there are two go programs (frontend/main.go and backend/main.go).
They will start in separate containers - each of which builds main.go by copying the code into a work directory and running
go build
there. The frontend and the backend happen to be in different modules in this sample.VS Code supports debugging two binaries together - a user can set breakpoints in both frontend/main.go and backend/main.go. VS Code by design sends breakpoint requests for all the files to all the debug adapters.
Since we cannot make any assumption on where the source code is copied in the remote container (i.e. in the sample, frontend/main.go is copied to /app/frontend/main.go, but it's also possible that the user just copy the source code to /app and build the binary from /app), the debug adapter tries to find the best match by doing some sort of longest suffix matching.
So, this longest suffix matching will end up associating /app/frontend/main.go on the remote frontend container with both frontend/main.go and backend/main.go in this specific example. As a result, the breakpoints set in backend/main.go will apply to the frontend/main.go.