connect(listWidget, SIGNAL(currentRowChanged(int)),
stackedWidget, SLOT(setCurrentIndex(int)));
- setWindowTitle(tr("Notepad"));
+ setWindowTitle(tr("FRIDA"));
openBinary(filename);
}
void Mainwindow::openBinary(const std::string& filename) {
if (filename != "") {
disassembler.reset(new LLVMDisassembler(filename));
+ disassembler->forEachFunction([&](uint64_t address, Function* fun) {
+ populateSymbolInformation(fun);
+ });
+
// curBin = new Binary(fileName.toStdString());
// std::vector<std::string> symbols = curBin->getSymbols();
}
}
-void Mainwindow::populateSymbolInformation(const std::string& sym) {
+void Mainwindow::populateSymbolInformation(Function* fun) {
QTabWidget * w = new QTabWidget();
// Listing
QGraphicsView * view = new QGraphicsView(scene);
w->addTab(view, "CFG");
- listWidget->addItem(sym.c_str());
+ listWidget->addItem(fun->getName().c_str());
stackedWidget->addWidget(w);
}