]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/Mainwindow.cxx
Make requestNewFunction pass a signal
[frida/frida.git] / src / gui / Mainwindow.cxx
index adadc0686a9a600d70f99b2e85dc9aae523a2499..850c0364b61ba1c4d5fc845586ba8913fe48f9d9 100644 (file)
@@ -90,6 +90,11 @@ Mainwindow::Mainwindow(InformationManager* mgr)
        QTreeWidgetItem * external = new QTreeWidgetItem(listWidget, QStringList("External Functions"));
        external->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
        external->setBackground(0, QBrush(QColor(0xff, 0xdd, 0xdd)));
+       connect(mgr, &InformationManager::resetEvent,
+               [this,mgr]() {
+                       connect(this, SIGNAL(requestNewFunctionByAddress(uint64_t)),
+                               mgr->getDisassembler(), SLOT(disassembleFunctionAt(uint64_t)));
+               });
        connect(mgr, &InformationManager::newFunctionEvent,
                [=] (NewFunctionEvent* event) {
                        std::string name = event->function->getName();
@@ -220,7 +225,7 @@ void Mainwindow::requestNewFunction() {
        NewFunctionDialog dialog;
        int result = dialog.exec();
        if (QDialog::Accepted == result) {
-               requestNewFunctionByAddress(dialog.result());
+               emit requestNewFunctionByAddress(dialog.result());
        } else {
                LOG4CXX_DEBUG(logger, "requestNewFunction aborted");
        }
@@ -238,12 +243,6 @@ void Mainwindow::requestNewGroup() {
        }
 }
 
-void Mainwindow::requestNewFunctionByAddress(uint64_t address) {
-       LOG4CXX_DEBUG(logger, "requesting Function at " << std::hex << address);
-       manager->getDisassembler()->disassembleFunctionAt(address);
-       switchMainPlaneToAddress(address);
-}
-
 void Mainwindow::renameFunction(Function* function) {
        SimpleStringDialog dialog("New name");
        int result = dialog.exec();