Fix #70 and Fix #72

This commit is contained in:
xarkes 2017-10-22 09:31:30 +02:00
parent df59a96094
commit 3c6f735832
4 changed files with 14 additions and 6 deletions

View File

@ -209,6 +209,7 @@ public:
void analyze(int level, QList<QString> advanced); void analyze(int level, QList<QString> advanced);
// Seek functions // Seek functions
bool graphDisplay = false;
void seek(QString addr); void seek(QString addr);
void seek(ut64 offset); void seek(ut64 offset);
void seekPrev(); void seekPrev();

View File

@ -80,9 +80,7 @@ void XrefsDialog::on_fromTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>(); XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
RAnalFunction *fcn = this->core->functionAt(xref.to); RAnalFunction *fcn = this->core->functionAt(xref.to);
// TODO Seek Core()->seek(xref.to);
//this->main->seek(xref.to, fcn ? QString::fromUtf8(fcn->name) : QString::null, true);
this->close(); this->close();
} }
@ -92,9 +90,7 @@ void XrefsDialog::on_toTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int c
XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>(); XrefDescription xref = item->data(0, Qt::UserRole).value<XrefDescription>();
RAnalFunction *fcn = this->core->functionAt(xref.from); RAnalFunction *fcn = this->core->functionAt(xref.from);
// TODO Seek Core()->seek(xref.from);
//this->main->seek(xref.from, fcn ? QString::fromUtf8(fcn->name) : QString::null, true);
this->close(); this->close();
} }

View File

@ -1410,6 +1410,7 @@ void DisassemblerGraphView::renderFunction(Function & func)
void DisassemblerGraphView::updateTimerEvent() void DisassemblerGraphView::updateTimerEvent()
{ {
qDebug() << "Update timer";
on_seekChanged(0); on_seekChanged(0);
return; return;
// TODO: Remove it if not used anymore // TODO: Remove it if not used anymore
@ -1641,6 +1642,13 @@ void DisassemblerGraphView::on_seekChanged(RVA addr)
{ {
Q_UNUSED(addr); Q_UNUSED(addr);
loadCurrentGraph(); 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]); this->renderFunction(this->analysis.functions[this->function]);
} }

View File

@ -356,6 +356,9 @@ bool DisassemblyWidget::eventFilter(QObject *obj, QEvent *event)
void DisassemblyWidget::on_seekChanged(RVA offset) void DisassemblyWidget::on_seekChanged(RVA offset)
{ {
Q_UNUSED(offset); Q_UNUSED(offset);
if (!Core()->graphDisplay) {
this->raise();
}
refreshDisasm(); refreshDisasm();
} }