]> git.siccegge.de Git - frida/frida.git/blobdiff - src/core/BasicBlock.hxx
Rework API for getting at instructions
[frida/frida.git] / src / core / BasicBlock.hxx
index 0df07b2a7283d3b270712d7be1477f996ea3cea9..3f877879c95942f6defc15111a69938b02948969 100644 (file)
@@ -4,7 +4,9 @@
 #include <cassert>
 #include <string>
 #include <sstream>
+#include <list>
 
+class Instruction;
 class Disassembler;
 class InformationManager;
 class QXmlStreamWriter;
@@ -12,13 +14,11 @@ class QXmlStreamReader;
 
 class BasicBlock {
 public:
-       uint64_t getStartAddress() const {
-               return start_address;
-       }
-
-       uint64_t getEndAddress() const {
-               return end_address;
-       }
+       InformationManager* getManager() const {return manager;}
+       uint64_t getStartAddress() const {return start_address;}
+       uint64_t getEndAddress() const {return end_address;}
+       void setStartAddress(uint64_t address) {start_address = address;}
+       void setEndAddress(uint64_t address) {end_address = address;}
 
        uint64_t getNextBlock(size_t index) const {
                assert(index < 2);
@@ -30,24 +30,13 @@ public:
                next_blocks[index] = address;
        }
 
-       void setStartAddress(uint64_t address) {
-               start_address = address;
-       }
-
-       void setEndAddress(uint64_t address) {
-               end_address = address;
-       }
-
        std::string getName() const {
                std::stringstream s;
                s << "BLOCK_" << std::hex << start_address << '_' << end_address;
                return s.str();
        }
 
-       InformationManager* getManager() const {
-               return manager;
-       }
-
+       std::list<Instruction> getInstructions() const;
        void serialize(QXmlStreamWriter& stream);
        static BasicBlock* deserialize(QXmlStreamReader& stream, InformationManager* manager);