]> git.siccegge.de Git - frida/frida.git/blobdiff - src/core/InformationManager.cxx
Pass the InformationManager inside the BasicBlock and Function classes
[frida/frida.git] / src / core / InformationManager.cxx
index 0907cf9d2d7f7eeb5a191781c4345e1fc3e5a72c..1234ac96aa64845775af2069a0bf73c901634d80 100644 (file)
@@ -1,8 +1,19 @@
 #include "InformationManager.hxx"
 #include "disassembler/llvm/LLVMDisassembler.hxx"
+#include "core/Function.hxx"
+#include "core/BasicBlock.hxx"
+
 #include "gui/qt.hxx"
-#include "quazip/quazip.h"
-#include "quazip/quazipfile.h"
+#include <quazip/quazip.h>
+#include <quazip/quazipfile.h>
+
+InformationManager::~InformationManager() {
+       for (BasicBlock * b : blocks)
+               delete b;
+
+       for (Function * f : functions)
+               delete f;
+}
 
 void InformationManager::reset(const std::string& filename) {
        disassembler.reset(createLLVMDisassembler(filename, this));
@@ -47,3 +58,10 @@ void InformationManager::save(const QString& filename) {
 
        zip.close();
 }
+
+void InformationManager::signal_new_function(Function* fun) {
+       functions.insert(fun);
+       for (auto b : fun->blocks())
+               blocks.insert(b.second);
+       new_function_signal(fun);
+}