Reoganize Function/BasicBlock creation
[frida/frida.git] / src / core / BasicBlock.hxx
index 0a759bf4d85875a2f153e14ba5cd4556d49f8c1b..69d4f37d9c85cb8643bccdd713bb40f9c9adf102 100644 (file)
@@ -6,16 +6,10 @@
 #include <sstream>
 
 class Disassembler;
+class InformationManager;
 
 class BasicBlock {
 public:
-       BasicBlock(uint64_t start_address, Disassembler * disassembler)
-               : start_address(start_address)
-               , disassembler(disassembler) {
-               next_blocks[0] = 0;
-               next_blocks[1] = 0;
-       }
-
        uint64_t getStartAddress() const {
                return start_address;
        }
@@ -42,21 +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();
        }
 
-       Disassembler * getDisassembler() {
-               return disassembler;
+       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