-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
New Data Structure for Source Lines to replace SDB #880
Conversation
02d9f08
to
ecd8f53
Compare
Would be nice to reuse it also for PDB too. |
Yes, it should be used for everything eventually. But actually I am not even sure if pdb right now supports line info at all. |
8cbc4f0
to
f4b2abd
Compare
f4b2abd
to
9d3e28c
Compare
3f0221e
to
132dd38
Compare
0431cd7
to
d7cbb2d
Compare
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 went through and it's a good quality code! 👍
While I think the API should be more abstracted from the fact that we use DWARF, PDB, or dlSYM, it's already a huge improvement and we can merge it right away, imho. Further improvements could be done as a separate issues/PRs
Yes. The main problem here is that we don't have any tests for this (yet) as it depends on your local filesystem contents. |
Added detailed info about going more format-agnostic here: #907 (comment) |
d7cbb2d
to
1d40ebd
Compare
This isn't handled nicely yet, I have to fix it. |
1d40ebd
to
9ac0ca0
Compare
All fixed, including the ugly |
Two failing tests:
|
9ac0ca0
to
f6b0f04
Compare
Fixed and updated unit tests to catch this. |
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.
Couldn't review everything :P I hope it won't break anything. I couldn't see the code coverage for this branch on codecov though. It would help to see which part are not covered at all by tests.
@@ -939,14 +947,18 @@ RZ_API void rz_bin_dwarf_loc_free(HtUP /*<offset, RzBinDwarfLocList*>*/ *loc_tab | |||
RZ_API void rz_bin_dwarf_debug_info_free(RzBinDwarfDebugInfo *inf); | |||
RZ_API void rz_bin_dwarf_debug_abbrev_free(RzBinDwarfDebugAbbrev *da); | |||
|
|||
RZ_API RzList *rz_bin_dwarf_parse_line(RzBinFile *binfile, RZ_NULLABLE RzBinDwarfDebugInfo *info, RzBinDwarfLineInfoMask mask); | |||
RZ_API char *rz_bin_dwarf_line_header_get_full_file_path(RZ_NULLABLE RzBinDwarfDebugInfo *info, const RzBinDwarfLineHeader *header, ut64 file_index); | |||
typedef char **RzBinDwarfLineFileCache; |
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.
what does this represent? A small doxygen-doc to explain it?
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.
Lets merge this and test a bit before the release, not to be untested. I think @thestr4ng3r could add a comment in a separate commit.
DO NOT SQUASH
Fix #843
Overview:
RzBinSourceRow
andsdb_addrinfo
are removed. Instead:RzBinSourceLineInfo
for holding a large amount of addr+line+column+filename samples in a memory-efficient way with O(log n) access by address.RzBinSourceLineInfo
can be conveniently constructed using theRzBinSourceLineInfoBuilder
by pushing samples in an arbitrary order into it and the builder will take care of creating a validRzBinSourceLineInfo
in a final step.RzBinSourceLineInfo
object is part ofRzBinObject
next to symbols, sections, etc. and can be in a bin plugin'slines
function, as it is done for dex and CoreSymbolication.CL
which wasn't really using meta but just messing around with thesdb_addrinfo
has been removed.ix
has been added (iX
removed and integrated here):For #676, this reduces the load time for me from ~1m to ~45s.
Memory usage (from massif) after loading this binary:
Before:
After:
So we get ~180MB vs. ~540MB. Getting lower than this is probably impossible while maintaining efficient access.