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

Get rid of stale jump arrows in disassembly widget. #3175

Merged
merged 1 commit into from
May 14, 2023

Conversation

beauby
Copy link
Contributor

@beauby beauby commented May 8, 2023

Your checklist for this pull request

Detailed description

This commit forces the jump arrows to be recomputed upon paintEvent, thus avoiding to draw stale arrows (e.g. after a jump instruction was edited).

Test plan (required)

Cf. #3114

Closing issues

closes #3114

@beauby
Copy link
Contributor Author

beauby commented May 8, 2023

Might also close #2854

@karliss
Copy link
Member

karliss commented May 8, 2023

If I remember correctly. Not clearing the list was intentional to better support following cases:

  • You look at the start of arrow and select the corresponding assembly line. Arrow gets hilighted. You start scrolling down to see the other end. The hilighted line will remain visible as long as it intersects current view even when both ends are invisible.

  • Keeping the arrows visible while they are still in screen also has the benefit of minimizing the arrow reordering which makes it easier to visually keep track of what goes where. It's hard to track arrows if their order keeps changing.

A better solution while keeping the two cases above would be to only wipe the arrows after actions that might modify the assembly. Doesn't have to be exact. It's fine if there are some false positives and it removes lines after modification which didn't change the jumps, for example replacing some mov with nop. But scrolling up and down shouldn't remove them, beside the existing code which removes arrows that go outside the screen.

@beauby beauby force-pushed the remove-stale-arrows branch from ccb8972 to 56d0ea2 Compare May 9, 2023 14:23
@beauby
Copy link
Contributor Author

beauby commented May 9, 2023

@karliss Thanks for the context. I updated the PR to only clear the arrow starting at that offset when an instruction is edited.

src/widgets/DisassemblyWidget.cpp Outdated Show resolved Hide resolved
This commit clears arrows from edited instructions, in order to avoid
stale arrows to remain drawn.

closes rizinorg#3114
@beauby beauby force-pushed the remove-stale-arrows branch from 56d0ea2 to 62a0d0f Compare May 11, 2023 10:04
Copy link
Member

@wargio wargio left a comment

Choose a reason for hiding this comment

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

I have tested the patch. it works correctly (at least on linux)

@XVilka XVilka merged commit a5fa410 into rizinorg:dev May 14, 2023
@beauby beauby deleted the remove-stale-arrows branch May 14, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Old jump arrow does not disappear after changing jump address
4 participants