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

x/tools/gopls: new CodeAction: "Show arm64 assembly for function f..." #67478

Open
adonovan opened this issue May 17, 2024 · 1 comment
Open
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented May 17, 2024

When optimizing code, or trying to track down some crash bugs, it can be helpful to inspect the assembly code that the compiler generates for a particular function. Gopls should add a "Source action..." (CodeAction) named "Show $GOARCH assembly for function f...", where $GOARCH is the current view's GOARCH, and f is the name of the function enclosing the selection. This would cause the LSP client to visit a web page containing the output of go build -gcflags=-S for that package, with the page scrolled to put the current function in view.

Bonus marks if each /blah/blah/foo.go:123 reference is replaced by a discreet link that navigates the client editor to that source location.

Even more bonus marks if assembly is post-processed so that block labels and control jumps are all connected up, in the style of @aclements' https://github.com/aclements/objbrowse.

@adonovan adonovan added this to the gopls/backlog milestone May 17, 2024
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 17, 2024
@gopherbot
Copy link

Change https://go.dev/cl/588395 mentions this issue: gopls/internal/golang: add "Show assembly of f" code action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants