diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index 4c18b57f..d892ffd1 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -132,7 +132,7 @@ DisassemblyWidget::DisassemblyWidget(MainWindow *main) connect(Core(), &CutterCore::functionRenamed, this, [this]() { refreshDisasm(); }); connect(Core(), SIGNAL(varsChanged()), this, SLOT(refreshDisasm())); connect(Core(), SIGNAL(asmOptionsChanged()), this, SLOT(refreshDisasm())); - connect(Core(), &CutterCore::instructionChanged, this, &DisassemblyWidget::refreshIfInRange); + connect(Core(), &CutterCore::instructionChanged, this, &DisassemblyWidget::instructionChanged); connect(Core(), &CutterCore::breakpointsChanged, this, &DisassemblyWidget::refreshIfInRange); connect(Core(), SIGNAL(refreshCodeViews()), this, SLOT(refreshDisasm())); @@ -226,6 +226,12 @@ void DisassemblyWidget::refreshIfInRange(RVA offset) } } +void DisassemblyWidget::instructionChanged(RVA offset) +{ + leftPanel->clearArrowFrom(offset); + refreshDisasm(); +} + void DisassemblyWidget::refreshDisasm(RVA offset) { if (!disasmRefresh->attemptRefresh(offset == RVA_INVALID ? nullptr : new RVA(offset))) { @@ -988,3 +994,12 @@ void DisassemblyLeftPanel::paintEvent(QPaintEvent *event) lastBeginOffset = lines.first().offset; } + +void DisassemblyLeftPanel::clearArrowFrom(RVA offset) +{ + auto it = std::find_if(arrows.begin(), arrows.end(), + [&](const Arrow &it) { return it.jmpFromOffset() == offset; }); + if (it != arrows.end()) { + arrows.erase(it); + } +} diff --git a/src/widgets/DisassemblyWidget.h b/src/widgets/DisassemblyWidget.h index 1ab16216..ce3e8a62 100644 --- a/src/widgets/DisassemblyWidget.h +++ b/src/widgets/DisassemblyWidget.h @@ -53,6 +53,7 @@ public slots: protected slots: void on_seekChanged(RVA offset); void refreshIfInRange(RVA offset); + void instructionChanged(RVA offset); void refreshDisasm(RVA offset = RVA_INVALID); bool updateMaxLines(); @@ -153,6 +154,7 @@ public: DisassemblyLeftPanel(DisassemblyWidget *disas); void paintEvent(QPaintEvent *event) override; void wheelEvent(QWheelEvent *event) override; + void clearArrowFrom(RVA offset); private: DisassemblyWidget *disas;