]> git.siccegge.de Git - frida/frida.git/blobdiff - src/core/InformationManager.cxx
Name functions in BasicBlock view
[frida/frida.git] / src / core / InformationManager.cxx
index 1234ac96aa64845775af2069a0bf73c901634d80..a274c418091e40efcab87f1f29821cb67ab3c5f9 100644 (file)
@@ -8,11 +8,11 @@
 #include <quazip/quazipfile.h>
 
 InformationManager::~InformationManager() {
-       for (BasicBlock * b : blocks)
-               delete b;
+       for (auto b : blocks)
+               delete b.second;
 
-       for (Function * f : functions)
-               delete f;
+       for (auto f : functions)
+               delete f.second;
 }
 
 void InformationManager::reset(const std::string& filename) {
@@ -27,7 +27,8 @@ void InformationManager::save(const QString& filename) {
        zip.setComment("FRIDA 0.0");
        QuaZipFile outZipFile(&zip);
 
-       for (Function* fun : functions) {
+       for (auto funpair : functions) {
+               Function* fun = funpair.second;
                QuaZipNewInfo zipinfo(fun->getName().c_str());
                zipinfo.setPermissions(static_cast<QFile::Permissions>(0x6444));
                outZipFile.open(QIODevice::WriteOnly, zipinfo);
@@ -60,8 +61,10 @@ void InformationManager::save(const QString& filename) {
 }
 
 void InformationManager::signal_new_function(Function* fun) {
-       functions.insert(fun);
-       for (auto b : fun->blocks())
-               blocks.insert(b.second);
+       functions.insert(std::make_pair(fun->getStartAddress(), fun));
+       for (auto b : fun->blocks()) {
+               BasicBlock* bl = b.second;
+               blocks.insert(std::make_pair(bl->getStartAddress(), bl));
+       }
        new_function_signal(fun);
 }