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

debug: warn users when debugging optimized binaries #1471

Closed
hyangah opened this issue May 5, 2021 · 4 comments
Closed

debug: warn users when debugging optimized binaries #1471

hyangah opened this issue May 5, 2021 · 4 comments
Assignees
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@hyangah
Copy link
Contributor

hyangah commented May 5, 2021

From #1446 by @JadenSimon

Delve allows users to debug optimized binaries, however, when using the Delve client it will warn you that the function is optimized after hitting a breakpoint. This means the user is not confused when local variables are not what they expect (i.e. missing or invalid). The Go extension's DA makes no attempt at alerting the user that they might be debugging an optimized binary, causing a lot of confusion when debugging does not work as expected. This is especially true when remote debugging, as it may be up to an external process to do the compilation.

@polinasok @suzmue Optimized bit is a property of Function. Is there any good way to surface this in UI/DAP?

@gopherbot gopherbot added this to the Untriaged milestone May 5, 2021
@hyangah hyangah added DlvDAP FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed DlvDAP labels May 5, 2021
@suzmue
Copy link
Contributor

suzmue commented May 5, 2021

We could surface this in the variables pane since this would be the feature that is most affected by the optimized function.

An option:

Before:
Screen Shot 2021-05-05 at 12 21 07 PM
After:
Screen Shot 2021-05-05 at 12 21 15 PM

We could also send a warning message to the Debug Console, but this may be less visible.

@suzmue suzmue self-assigned this May 5, 2021
@hyangah hyangah modified the milestones: Untriaged, Backlog May 5, 2021
@polinasok
Copy link
Contributor

polinasok commented May 6, 2021

A pop-up would be ideal, but I don't know of a way to trigger it other than an error response, which wouldn't apply here. I agree that logging to Debug Console might get lost (although we could make it more noticeable with stderr context color) and something more visible would be helpful. Labeling variable scopes is pretty clever.

@suzmue
Copy link
Contributor

suzmue commented Jun 7, 2021

This has now been implemented in delve dap, by adding the annotation to the scope name:

Screen Shot 2021-06-07 at 5 35 57 PM

@JadenSimon @polinasok @hyangah Is this sufficient? If you think this takes care of the problem we can close this issue.

@JadenSimon
Copy link
Contributor

Yeah looks great!

@golang golang locked and limited conversation to collaborators Jun 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants