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/cmd/guru: extend 'definition' to understand go:linkname and assembly #20050

Closed
mdempsky opened this issue Apr 20, 2017 · 1 comment
Closed
Labels
FeatureRequest Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@mdempsky
Copy link
Contributor

This is a bit of a ponies request, but it would be really convenient while working on the standard library if "guru definition" could handle go:linkname and assembly. Here's how I would suggest this work:

  1. If definition resolves an identifier to a non-function declaration or a function declaration with a function body, do the same thing as now.
  2. If there's a go:linkname comment in any of the .go files that references the function name, then recursively look for the remote name's definition.
  3. Search the package's .s files for a TEXT declaration that declares the function symbol; if found, return that location.
  4. If the function declaration is within $GOROOT, then apply steps 2 and 3 but searching within package runtime instead.
  5. Else, return the body-less function declaration's position.

The order of steps 2 and 3 aren't critical.

Step 4 is clunky, but necessary for the standard repo. I think outside of the standard library steps 2 and 3 alone should suffice.

/cc @alandonovan

@mdempsky mdempsky added this to the Unplanned milestone Apr 20, 2017
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@adonovan
Copy link
Member

guru was deleted in #65880; closing as obsolete. Incidentally, gopls understands linkname (though not assembly, which would indeed be nice).

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

No branches or pull requests

3 participants