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

prog.symbol() finds static functions by address but not by name #47

Closed
sdimitro opened this issue Feb 21, 2020 · 2 comments
Closed

prog.symbol() finds static functions by address but not by name #47

sdimitro opened this issue Feb 21, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sdimitro
Copy link
Contributor

Example case - the static function slab_bug cannot be found by name in prog.symbol()

>>> prog.symbol('slab_bug')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
LookupError: could not find symbol with name 'slab_bug'

But if we the the address of its Object and pass this to the same function it is returned:

>>> prog.symbol(prog['slab_bug'].address_of_())
Symbol(name='slab_bug', address=0xfffffffface933c0, size=0xb5)

Not sure if this is on purpose but I did find it surprising.

@osandov
Copy link
Owner

osandov commented Feb 21, 2020

Right now, it only looks for global symbols, and static functions are local symbols. It should be pretty easy to look for local symbols, too, but there may be multiple local symbols with the same name, so we might want to add Program.symbols() that gets all matches.

@osandov
Copy link
Owner

osandov commented Dec 21, 2021

Closed by ff40f65.

@osandov osandov closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants