From 3c6f7358324096bfc139db0d7c9484c5e45a0131 Mon Sep 17 00:00:00 2001 From: xarkes Date: Sun, 22 Oct 2017 09:31:30 +0200 Subject: [PATCH] Fix #70 and Fix #72 --- src/cutter.h | 1 + src/dialogs/XrefsDialog.cpp | 8 ++------ src/widgets/DisassemblerGraphView.cpp | 8 ++++++++ src/widgets/DisassemblyWidget.cpp | 3 +++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/cutter.h b/src/cutter.h index da94ac8a..55c6d403 100644 --- a/src/cutter.h +++ b/src/cutter.h @@ -209,6 +209,7 @@ public: void analyze(int level, QList advanced); // Seek functions + bool graphDisplay = false; void seek(QString addr); void seek(ut64 offset); void seekPrev(); diff --git a/src/dialogs/XrefsDialog.cpp b/src/dialogs/XrefsDialog.cpp index de76e5a2..f4261875 100644 --- a/src/dialogs/XrefsDialog.cpp +++ b/src/dialogs/XrefsDialog.cpp @@ -80,9 +80,7 @@ void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int XrefDescription xref = item->data(0, Qt::UserRole).value(); RAnalFunction *fcn = this->core->functionAt(xref.to); - // TODO Seek - //this->main->seek(xref.to, fcn ? QString::fromUtf8(fcn->name) : QString::null, true); - + Core()->seek(xref.to); this->close(); } @@ -92,9 +90,7 @@ void XrefsDialog::on_toTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int c XrefDescription xref = item->data(0, Qt::UserRole).value(); RAnalFunction *fcn = this->core->functionAt(xref.from); - // TODO Seek - //this->main->seek(xref.from, fcn ? QString::fromUtf8(fcn->name) : QString::null, true); - + Core()->seek(xref.from); this->close(); } diff --git a/src/widgets/DisassemblerGraphView.cpp b/src/widgets/DisassemblerGraphView.cpp index 2f984b6f..beadfd71 100644 --- a/src/widgets/DisassemblerGraphView.cpp +++ b/src/widgets/DisassemblerGraphView.cpp @@ -1410,6 +1410,7 @@ void DisassemblerGraphView::renderFunction(Function & func) void DisassemblerGraphView::updateTimerEvent() { + qDebug() << "Update timer"; on_seekChanged(0); return; // TODO: Remove it if not used anymore @@ -1641,6 +1642,13 @@ void DisassemblerGraphView::on_seekChanged(RVA addr) { Q_UNUSED(addr); loadCurrentGraph(); + Function f = this->analysis.functions[this->function]; + if (f.blocks.size() > 0) { + Core()->graphDisplay = true; + this->parentWidget()->raise(); + } else { + Core()->graphDisplay = false; + } this->renderFunction(this->analysis.functions[this->function]); } diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index e8673385..cba1904f 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -356,6 +356,9 @@ bool DisassemblyWidget::eventFilter(QObject *obj, QEvent *event) void DisassemblyWidget::on_seekChanged(RVA offset) { Q_UNUSED(offset); + if (!Core()->graphDisplay) { + this->raise(); + } refreshDisasm(); }