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

address and instruction bytes column overlap after reopening #752

Open
sorokin opened this issue Feb 22, 2020 · 0 comments
Open

address and instruction bytes column overlap after reopening #752

sorokin opened this issue Feb 22, 2020 · 0 comments

Comments

@sorokin
Copy link
Contributor

sorokin commented Feb 22, 2020

If I make address column too small and then close edb and then open it again, I get disassembly view that looks like this:

disassembly-view-after-load

If I trace the values of l1, l2, l3, l4 in DrawingContext I will get something like this: (165 380 231 1194), while before reopening it was (165 190 223 11940). As I found out the line2_ loaded correctly in QDisassemblyView::restoreState and then is reset to 0 in QDisassemblyView::setRegion.

At first my diff to fix the problem was:

$ git diff --cached
diff --git a/src/widgets/QDisassemblyView.cpp b/src/widgets/QDisassemblyView.cpp
index fc44ae2d..eaafca09 100644
--- a/src/widgets/QDisassemblyView.cpp
+++ b/src/widgets/QDisassemblyView.cpp
@@ -535,10 +535,6 @@ void QDisassemblyView::setRegion(const std::shared_ptr<IRegion> &r) {
                setAddressOffset(region_ ? region_->start() : edb::address_t(0));
                updateScrollbars();
                Q_EMIT regionChanged();
-
-               if (line2_ != 0 && line2_ < autoLine2()) {
-                       line2_ = 0;
-               }
        }
        update();
 }

You might compare it with this commit 8f2c831. :-)

Now the question is what is the proper way of fixing the problem. One might argue that writing line2_ without updating line3_ and line4_ breaks class invariants. And updating them too would fix the visual glitch, but I would say that resetting column widths set by user is not a good behavior.

To fix the visual glitch, but also to address #492, I would like to suggest having different column width settings for 32 and for 64 bit modes.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

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

No branches or pull requests

1 participant