-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: Implement Frame Remapping #11
Conversation
This essentially reimplements the whole parser, as well as a java stacktrace parser. The main focus is on the `Mapper::remap_frame` function, which creates a new `StackFrame`, while de-obfuscating class and method names, re-mapping lines, and resolving inline functions.
This allows re-mapping with just the class-name and method-name, without any line records.
|
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.
Very excited about this rewrite! Thanks for putting the effort in.
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.
This is great. 🎉 The separation and API are great. I have a bunch of really small nit picks now, and then this is G2G!
One thing that struck me, though: We do not expose any parsing errors. If parsing the file fails, we just receive None
, but we don't know what it was that threw us off. This can become a challenge in debugging new formats, since there won't be any alerting when records are skipped silently, etc. Should we expose an error type for those and change the record iterator to return Result<Record, ProguardError>
?
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.
Wouldn't link into Sentry docs on this crate, since it is completely independent of Sentry. Aside from that, 🚢 it!
I was also thinking about this. From a high level perspective, I think it should re-map as much as it can rather than failing the whole file. The record iterator is line-based, which should hopefully give enough context. I was also thinking about making it |
👍 Yes, fully agree with this.
It could still return
I still haven't got a good feeling for when to use this. Would say to leave it exhaustive and then major-bump if we add support for a major new format that has new capabilities. WDYT? |
Yes, on second thought, non_exhaustive can be quite a pain to use, even if it is just for integration tests.
The iterator does: https://github.com/getsentry/rust-proguard/pull/11/files#diff-90baa1ca016fe9c6cc78a9f5b29770d3R130 |
Sorry, I was typing too quick. I meant a All these are optional -- the current interface is fine from my end, so feel free to merge. |
This essentially reimplements the whole parser, as well as a java
stacktrace parser.
The main focus is on the
ProguardMapper::remap_frame
function, which createsa new
StackFrame
, while de-obfuscating class and method names,re-mapping lines, and resolving inline functions.