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

Expose symbol kind constants such as S_PUB32 #120

Open
mstange opened this issue May 21, 2022 · 3 comments
Open

Expose symbol kind constants such as S_PUB32 #120

mstange opened this issue May 21, 2022 · 3 comments
Milestone

Comments

@mstange
Copy link
Collaborator

mstange commented May 21, 2022

Symbol has a public raw_kind method. But it's hard to do anything with the return value because it's a raw number and none of the constants you could compare it to are exposed.

For example, there are no results when searching the docs for S_PUB32.

I'd like to use raw_kind so that I can avoid calling parse on symbols which I intend to skip, for better performance. (Profile)

@jan-auer
Copy link
Member

jan-auer commented Jun 2, 2022

I'd like to use raw_kind so that I can avoid calling parse on symbols which I intend to skip, for better performance. (Profile)

Thanks that makes sense. The only issue I see with this is that it requires you to know the raw kinds for each of the symbols you'd like to parse. I'll tinker on this to see if I find a more convenient API.

Exposing the constants makes sense regardless. So far, we have them all exposed in enums like CPUType, which are great to match on, but not to work with as values. I'm now thinking of exposing them similar to gimli's constants module, in a typed yet open fashion.

@mstange
Copy link
Collaborator Author

mstange commented Jun 3, 2022

Exposing the constants makes sense regardless. So far, we have them all exposed in enums like CPUType, which are great to match on, but not to work with as values. I'm now thinking of exposing them similar to gimli's constants module, in a typed yet open fashion.

That sounds good to me.

@jan-auer
Copy link
Member

jan-auer commented Jun 8, 2022

I'll have to move this to the next milestone and will release 0.8.0 without this for now.

@jan-auer jan-auer modified the milestones: 0.8.0, 0.9.0 Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants