X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FFunction.hxx;fp=src%2Fcore%2FFunction.hxx;h=3c8f799543c8d3acb5901951a64cf9bb96246e74;hp=0000000000000000000000000000000000000000;hb=32e87746db981882b95aceddde79ef12034a3405;hpb=bc07dbf3889f93f65c4b73f911aa280afdd906fb diff --git a/src/core/Function.hxx b/src/core/Function.hxx new file mode 100644 index 0000000..3c8f799 --- /dev/null +++ b/src/core/Function.hxx @@ -0,0 +1,35 @@ +#ifndef INCLUDE__Function_hxx +#define INCLUDE__Function_hxx + +#include +#include "BasicBlock.hxx" + +class Function { +public: + Function(const std::string& name, uint64_t start_address) + : name(name) + , start_address(start_address) { + } + + uint64_t getStartAddress() const { + return start_address; + } + + std::string getName() const { + return name; + } + + void addBasicBlock(BasicBlock* block) { + _blocks.insert(std::make_pair(block->getStartAddress(), block)); + } + + std::map& blocks() { + return _blocks; + } +private: + std::string name; + uint64_t start_address; + std::map _blocks; +}; + +#endif