+void Mainwindow::renameFunction(Function* function) {
+ SimpleStringDialog dialog("New name");
+ int result = dialog.exec();
+ if (QDialog::Accepted == result) {
+ LOG4CXX_DEBUG(logger, "renaming Function " << function->getName()
+ << " to " << dialog.result().toStdString());
+ function->setName(dialog.result().toStdString());
+ objects_list_by_address[function->getStartAddress()]->setText(0, dialog.result());
+ } else {
+ LOG4CXX_DEBUG(logger, "renameFunction aborted");
+ }
+}
+
+void Mainwindow::renameGroup(QTreeWidgetItem* item) {
+ SimpleStringDialog dialog("New name");
+ int result = dialog.exec();
+ if (QDialog::Accepted == result) {
+ LOG4CXX_DEBUG(logger, "renaming group " << item->text(0).toStdString()
+ << " to " << dialog.result().toStdString());
+ item->setText(0, dialog.result());
+ } else {
+ LOG4CXX_DEBUG(logger, "renameFunction aborted");
+ }
+}
+
+void Mainwindow::addFunction(Function* fun) {
+ if (functions.find(fun->getStartAddress()) != functions.end())
+ return;
+
+ functions.insert(std::make_pair(fun->getStartAddress(), fun));
+
+ FunctionWidget * w = new FunctionWidget(fun);
+
+ // CFG
+ CFGScene * scene = new CFGScene;
+
+ BasicBlock * block = manager->getBasicBlock(fun->getStartAddress());
+
+ uint64_t start_address(std::numeric_limits<uint64_t>::max());
+ for (auto b : fun->blocks()) {
+ if (b.first < start_address)
+ start_address = b.first;
+ }
+
+ local__add_basic_block(block, this,
+ manager, blocks, scene, start_address, 100);
+
+ QGraphicsView * view = new QGraphicsView(scene);
+ w->addTab(view, "CFG");