]> git.siccegge.de Git - frida/frida.git/blobdiff - src/disassembler/BasicBlock.hxx
Use target addresses for basic block linking
[frida/frida.git] / src / disassembler / BasicBlock.hxx
index 22a31e097e2469a2adc1b298af41b46a1f97648c..1952f2bdac8d2732585b2f76cd50a778da2d9069 100644 (file)
@@ -1,8 +1,46 @@
+#ifndef INCLUDE__BasicBlock_hxx
+#define INCLUDE__BasicBlock_hxx
 
+#include <cassert>
 
 class BasicBlock {
 public:
+    BasicBlock() {
+               next_blocks[0] = 0;
+               next_blocks[1] = 0;
+       }
+
+    uint64_t getStartAddress() const {
+        return start_address;
+    }
+
+    uint64_t getEndAddress() const {
+        return end_address;
+    }
+
+       uint64_t getNextBlock(size_t index) const {
+               assert(index < 2);
+               return next_blocks[index];
+       }
+
+       void setNextBlock(size_t index, uint64_t address) {
+               assert(index < 2);
+               next_blocks[index] = address;
+       }
+
+       void setStartAddress(uint64_t address) {
+               start_address = address;
+       }
+
+       void setEndAddress(uint64_t address) {
+               end_address = address;
+       }
 
 private:
+    uint64_t start_address;
+    uint64_t end_address;
 
+    uint64_t next_blocks[2];
 };
+
+#endif