-
Notifications
You must be signed in to change notification settings - Fork 80
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
DWARF debug symbols parsing in ELF files #1564
Conversation
Because the DebugInfo must outlive the file bytes.
} | ||
} | ||
|
||
/// Index the symbols by their addresses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't this simply be a Map<addr, Vec|Set<String>>
? The names are already disambiguated from dedup_names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can be multiple names pointing to the same address, which is fine and it being handled here, and that is a different problem of the same name being used to point to different places (that is solved by dedup_names
).
And sure, that is one way of turning a map into a multimap. Do you think that is much better than using a key disambiguator, like I did?
One one hand, I don't like the extra indirection in Map<addr, Vec<String>>
, on the other, the way I did probably uses more memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't think about performance here, doesn't seem like it will matter much, just felt conceptually simpler: HashMap<key, Vec<values>>
is obviously a multimap (and doesn't need to be a BTree as there's no need for range/ordered access)... with the disambiguator i thought sth more complicated was happening at first. But I guess not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write a rust crate with a proper multimap using a hash table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to fix this... but since it is merged, doesn't sound so fun anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do then
For the Keccak test the generated powdr-asm file is almost 100kb smaller, I wonder why |
it seems to do some more optimizations (e.g., noticed some inlining that didn't happen before) |
I think this is mainly due to two things:
|
Conversion from ELF now has feature parity with conversion from assembly, so I am setting it as the default.