]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/Mainwindow.cxx
Pass function instead of name
[frida/frida.git] / src / gui / Mainwindow.cxx
index fd0c24595da1bfe0efc675ac395970ccce764ece..fb713fc57d3b4ca55c8ef9ab4dc286abfe3035a9 100644 (file)
@@ -36,7 +36,7 @@ Mainwindow::Mainwindow(const std::string& filename)
     connect(listWidget, SIGNAL(currentRowChanged(int)),
             stackedWidget, SLOT(setCurrentIndex(int)));
 
-    setWindowTitle(tr("Notepad"));
+    setWindowTitle(tr("FRIDA"));
 
        openBinary(filename);
 }
@@ -62,6 +62,10 @@ void Mainwindow::open() {
 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();
@@ -73,7 +77,7 @@ void Mainwindow::openBinary(const std::string& filename) {
     }
 }
 
-void Mainwindow::populateSymbolInformation(const std::string& sym) {
+void Mainwindow::populateSymbolInformation(Function* fun) {
     QTabWidget * w = new QTabWidget();
 
     // Listing
@@ -120,6 +124,6 @@ void Mainwindow::populateSymbolInformation(const std::string& sym) {
     QGraphicsView * view = new QGraphicsView(scene);
     w->addTab(view, "CFG");
 
-    listWidget->addItem(sym.c_str());
+    listWidget->addItem(fun->getName().c_str());
     stackedWidget->addWidget(w);
 }