X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FInformationManager.cxx;h=a274c418091e40efcab87f1f29821cb67ab3c5f9;hp=1234ac96aa64845775af2069a0bf73c901634d80;hb=440c4598343d9e46d8963f7753c122b121826334;hpb=3894c7f40260a8f5f4b47e82860ae40ec592efc1 diff --git a/src/core/InformationManager.cxx b/src/core/InformationManager.cxx index 1234ac9..a274c41 100644 --- a/src/core/InformationManager.cxx +++ b/src/core/InformationManager.cxx @@ -8,11 +8,11 @@ #include 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(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); }