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

Open
mdempsky opened this issue Apr 20, 2017 · 0 comments
Open

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Apr 20, 2017

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 label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.