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

Sync hex.pairs eval to "Bytes as pairs" in Hexdump #1586

Merged
merged 2 commits into from
May 29, 2019

Conversation

ITAYC0HEN
Copy link
Member

Detailed description

This PR will make sure the hex.pairs setting is synced with the Hex Pairs action in the Hex Dump widget.

Test plan (required)
Enable "Bytes as pairs" in hex widget
Execute "e hex.pairs" in Console and verify it is true
Disable "Bytes as pairs" in hex widget
Execute "e hex.pairs" in Console and verify it is false

hex_pairs

Closing issues

closes #1060

Copy link
Member

@karliss karliss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of multiple hex widgets state can get de-synchronized. The same happens when changing e.hexpairs in console. Do we want to support that?

@ITAYC0HEN
Copy link
Member Author

Yes they will indeed get de-synchronized since we do have a support ofr multiple hex and r2 doesnt. In this solution, different hex widgets can be with different states for enabling Hex pairs. Unless the metric is recalculated and then they will get into sync again:

unsyncedpairs

@karliss
Copy link
Member

karliss commented May 25, 2019

More of thoughts about similar settings in future

There are two possible behaviors for settings like this:

  • It is consider a global view configuration and gets always synchronized. Mostly synchronizing with some exceptions feel buggy.
  • It is considered a view specific setting, there is no synchronization. If saved then saved as part of view layout.

Column count and number base is more of second category. You might want to look at the same data in two different modes in parallel.

Font is the first category.

I feel that hex.pairs is somewhere in the middle, maybe closer to first category. Having support of multiple hex.pairs values in r2 doesn't make sense.

@Maijin Maijin added this to In progress in Hexdump Widget via automation May 25, 2019
@ITAYC0HEN
Copy link
Member Author

Good points 👍
what do you think would be the best way to handle this pr? Approve it as is? Do you have any concrete improvements you wish to see?

Copy link
Member

@karliss karliss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are simple and they improve things. Assuming three is no signal that could be easily connected for detecting config changes good enough for merge.

@ITAYC0HEN ITAYC0HEN merged commit 53756f2 into rizinorg:master May 29, 2019
Hexdump Widget automation moved this from In progress to Done May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Support hex.pairs eval variable in Hexdump Widget
2 participants