-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Serialize seek history #3838
Serialize seek history #3838
Conversation
769421d
to
febce1b
Compare
Updated the |
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.
Looks good, just some small details.
febce1b
to
05cb958
Compare
Fixed these, thanks for the review! |
05cb958
to
5af2fa1
Compare
Update for the |
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.
LGTM
CI fails on MSVC because it doesn't support VLAs (in |
librz/core/serialize_core_seek.c
Outdated
if (child->type != RZ_JSON_INTEGER) { | ||
break; | ||
} | ||
seek_item.cursor = child->num.s_value; |
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.
why s_value
instead of u_value
here?
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.
Because cursor
in RzCoreSeekItem
is an int
, so I assumed it may be negative sometimes?
5af2fa1
to
4b855eb
Compare
Update for typo & MSVC build failure. |
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.
Overall a sensible addition and good code!
4b855eb
to
0172df8
Compare
Updated with the suggested changes, thanks for the review! |
Not sure what's wrong with the failed |
Your checklist for this pull request
Detailed description
This PR implements seek history serialization/deserialization to/from the Rizin project file.
This is something that I feel is worth preserving across sessions, as seek history is often the logical path the user took to reach some location within the binary. I know in my case I often use it as a lifeline to go back up when I go down some rabbit hole in a binary, and having that lifeline lost if I close Rizin is annoying, hence the PR.
Since I'm new to this code base, there are a number of implementation details that I feel I should mention:
"is_current": true
), which is somewhat redundant with thecore/offset
entry (not fully redundant since the current seek history item also holds the cursor position which is otherwise not saved)core/offset
and use exclusively the offset from the current seek history itemTest plan
Green CI, incl. added unit tests (for seek history serialization & the new
rz_vector_swap
API) and integration tests (for the bumped project version).Closing issues
N/A