X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FFunction.hxx;h=3a328f6d203c027b57acf18b034477d4ff7192cd;hp=b57dca2706edd31df2b31798c18d5ebedf301017;hb=HEAD;hpb=440c4598343d9e46d8963f7753c122b121826334 diff --git a/src/core/Function.hxx b/src/core/Function.hxx index b57dca2..3a328f6 100644 --- a/src/core/Function.hxx +++ b/src/core/Function.hxx @@ -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& 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 _blocks; + + friend class InformationManager; }; #endif