]> git.siccegge.de Git - frida/frida.git/blobdiff - src/core/Function.hxx
Add doc repo as submodule
[frida/frida.git] / src / core / Function.hxx
index b57dca2706edd31df2b31798c18d5ebedf301017..3a328f6d203c027b57acf18b034477d4ff7192cd 100644 (file)
@@ -5,22 +5,22 @@
 #include "BasicBlock.hxx"
 
 class InformationManager;
+class QXmlStreamWriter;
+class QXmlStreamReader;
 
 class Function {
 public:
-       Function(const std::string& name, uint64_t start_address, InformationManager* manager);
+       uint64_t getStartAddress() const { return start_address; }
 
-       uint64_t getStartAddress() const {
-               return start_address;
-       }
-
-       std::string getName() const
-               { return name; }
+       std::string getName() const { return name; }
        void setName(const std::string& new_name);
 
-       InformationManager* getManager() const {
-               return manager;
-       }
+       InformationManager* getManager() const { return manager; }
+
+       /* Dynamic functions are the ones which are imported from shared
+        * libraries and not structly part of the binary at hand
+        */
+       bool isDynamic() const { return dynamic; }
 
        void addBasicBlock(BasicBlock* block) {
                _blocks.insert(std::make_pair(block->getStartAddress(), block));
@@ -29,11 +29,20 @@ public:
        const std::map<uint64_t, BasicBlock*>& blocks() {
                return _blocks;
        }
+
+       void serialize(QXmlStreamWriter& stream);
+       static Function* deserialize(QXmlStreamReader& stream, InformationManager* manager);
+
 private:
+       Function(uint64_t start_address, bool dynamic, InformationManager* manager);
+
        std::string name;
        uint64_t start_address;
+       bool dynamic;
        InformationManager * manager;
        std::map<uint64_t, BasicBlock*> _blocks;
+
+       friend class InformationManager;
 };
 
 #endif