Reoganize Function/BasicBlock creation
[frida/frida.git] / src / core / BasicBlock.hxx
index b3e5a89d819cfbd74c5b375919eba6dcccd7e09a..69d4f37d9c85cb8643bccdd713bb40f9c9adf102 100644 (file)
@@ -5,13 +5,11 @@
 #include <string>
 #include <sstream>
 
+class Disassembler;
+class InformationManager;
+
 class BasicBlock {
 public:
-       BasicBlock() {
-               next_blocks[0] = 0;
-               next_blocks[1] = 0;
-       }
-
        uint64_t getStartAddress() const {
                return start_address;
        }
@@ -38,17 +36,30 @@ public:
                end_address = address;
        }
 
-       std::string getName() {
+       std::string getName() const {
                std::stringstream s;
                s << "BLOCK_" << std::hex << start_address << '_' << end_address;
                return s.str();
        }
 
+       InformationManager* getManager() const {
+               return manager;
+       }
 private:
+       BasicBlock(uint64_t start_address, InformationManager* manager)
+               : start_address(start_address)
+               , manager(manager) {
+               next_blocks[0] = 0;
+               next_blocks[1] = 0;
+       }
+
        uint64_t start_address;
        uint64_t end_address;
-
+       Disassembler* disassembler;
+       InformationManager* manager;
        uint64_t next_blocks[2];
+
+       friend class InformationManager;
 };
 
 #endif