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

debugAdapter: add go module name check #606

Closed
wants to merge 8 commits into from
Closed

debugAdapter: add go module name check #606

wants to merge 8 commits into from

Conversation

quoctruong
Copy link
Contributor

@quoctruong quoctruong commented Sep 3, 2020

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.

@googlebot googlebot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Sep 3, 2020
@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@polinasok polinasok changed the title add go module name check debugAdapter: add go module name check Sep 4, 2020
@gopherbot
Copy link
Collaborator

Message from Polina Sokolova:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Quoc Truong:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Hyang-Ah Hana Kim:

Patch Set 2:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Quoc Truong:

Patch Set 4:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 5:

Kokoro presubmit build starting for golang/vscode-go/gcp_ubuntu/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/07e9ffd3-446f-4738-9477-4e06a5b75138


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 5: TryBot-Result-1

Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/07e9ffd3-446f-4738-9477-4e06a5b75138


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Hyang-Ah Hana Kim:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Quoc Truong:

Patch Set 5:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Quoc Truong:

Patch Set 6: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 6:

Kokoro presubmit build starting for golang/vscode-go/gcp_ubuntu/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/37114e37-fb9f-415a-a581-f7c520f73b00


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 6: TryBot-Result+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/37114e37-fb9f-415a-a581-f7c520f73b00


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Hyang-Ah Hana Kim:

Patch Set 6:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Quoc Truong:

Patch Set 6:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 8:

Kokoro presubmit build starting for golang/vscode-go/gcp_ubuntu/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/32bdf659-aa32-48e1-ab1c-d686dc3a7b4f


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 8: TryBot-Result-1

Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/32bdf659-aa32-48e1-ab1c-d686dc3a7b4f


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Quoc Truong:

Patch Set 8:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Polina Sokolova:

Patch Set 9:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Polina Sokolova:

Patch Set 9:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Quoc Truong:

Patch Set 9:

(5 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Polina Sokolova:

Patch Set 11:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/253038.
After addressing review feedback, remember to publish your drafts!

@hyangah
Copy link
Contributor

hyangah commented Dec 16, 2021

Thanks @quoctruong - I am currently cleaning up obsolete PRs.
As Cloud Code is planning to migrate to dlv dap, let's see if we can approach this issue in a different way (e.g. autopopulate substitutePath, etc)

@hyangah hyangah closed this Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants