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

doc(debug): add why breakpoints may fail and clean up manual configuration #6893

Merged
merged 5 commits into from
Dec 14, 2021

Conversation

briandealwis
Copy link
Member

@quoctruong, @etanshaul: should we add anything else here for Go, like -trimpath?

@briandealwis briandealwis requested a review from a team as a code owner November 22, 2021 16:40
@briandealwis briandealwis requested a review from nkubala November 22, 2021 16:40
@google-cla google-cla bot added the cla: yes label Nov 22, 2021
@etanshaul
Copy link
Contributor

etanshaul commented Nov 22, 2021

What do you think about adding IDE specific instructions (since I'd imagine nearly all users of debug are using one of the IDEs unless they are....adventurous). Some JB specific things I can think of:

  • GoLand (and Ultimate + Go plugin) does not support source mapping. Rather, the application must be a Go modules based app AND the user must explicitly configure the IDE to use Go modules in the IDE settings.
  • Go, Python, and Javascript debugging in IDEA Ultimate requires the corresponding language plugin to be installed. If it is not installed, the debugger will not attach and breakpoints will not be hit (though the skaffold debug session will still start up).

I don't recall what we found with regards to -trimpath. I vaguely remember a conversation around this where it turned out to be useful in IntelliJ but I don't recall the specifics. Will update if I can dig it up.

@briandealwis
Copy link
Member Author

PTAL @etanshaul

Include note for `cannot find debugger path` errors.
@codecov
Copy link

codecov bot commented Nov 30, 2021

Codecov Report

Merging #6893 (66149bf) into main (290280e) will decrease coverage by 1.64%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6893      +/-   ##
==========================================
- Coverage   70.48%   68.83%   -1.65%     
==========================================
  Files         515      551      +36     
  Lines       23150    25301    +2151     
==========================================
+ Hits        16317    17416    +1099     
- Misses       5776     6712     +936     
- Partials     1057     1173     +116     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/deploy.go 52.00% <ø> (-1.85%) ⬇️
cmd/skaffold/app/cmd/dev.go 84.61% <0.00%> (ø)
cmd/skaffold/app/cmd/render.go 36.66% <0.00%> (-4.72%) ⬇️
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/inspect_tests.go 62.50% <14.28%> (-1.14%) ⬇️
cmd/skaffold/app/cmd/fix.go 68.85% <40.00%> (-7.62%) ⬇️
cmd/skaffold/app/cmd/lint.go 42.85% <42.85%> (ø)
cmd/skaffold/app/cmd/find_configs.go 48.88% <50.00%> (+0.24%) ⬆️
cmd/skaffold/app/skaffold.go 76.19% <70.00%> (-8.43%) ⬇️
cmd/skaffold/app/cmd/inspect_build_env.go 65.11% <75.00%> (+6.39%) ⬆️
... and 170 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b87553...66149bf. Read the comment docs.

corresponding language plugin to be installed. If it is not installed,
the debugger will not attach and breakpoints will not be hit.

**Breakpoints on startup path are not hit.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by startup path here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the container execution initialization path (e.g., from main() to listening)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retitled: let me know if that's still unclear.

Comment on lines 434 to 435
If this mapping is incorrect, then the remote debugging runtime
will not be able to find the source file for the breakpoint.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to manually fix this mapping ? any pointers on how users can look into this setting and where it is configured.

Comment on lines +439 to +440
intended for deployment. In these cases, the source mapping must
use the build-time paths. For example, many Go builds use a `golang`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah looks like you have documented resolution here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add more details around how to fix it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud Code generally prompts in these situations. It really is IDE-by-IDE

@tejal29 tejal29 merged commit ecf8818 into GoogleContainerTools:main Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants