]> git.siccegge.de Git - frida/frida.git/blob - src/core/Function.hxx
Pass the InformationManager inside the BasicBlock and Function classes
[frida/frida.git] / src / core / Function.hxx
1 #ifndef INCLUDE__Function_hxx
2 #define INCLUDE__Function_hxx
3
4 #include <map>
5 #include "BasicBlock.hxx"
6
7 class InformationManager;
8
9 class Function {
10 public:
11 Function(const std::string& name, uint64_t start_address,
12 InformationManager* manager)
13 : name(name)
14 , start_address(start_address)
15 ,manager(manager) {}
16
17 uint64_t getStartAddress() const {
18 return start_address;
19 }
20
21 std::string getName() const {
22 return name;
23 }
24
25 InformationManager* getManager() const {
26 return manager;
27 }
28
29 void addBasicBlock(BasicBlock* block) {
30 _blocks.insert(std::make_pair(block->getStartAddress(), block));
31 }
32
33 std::map<uint64_t, BasicBlock*>& blocks() {
34 return _blocks;
35 }
36 private:
37 std::string name;
38 uint64_t start_address;
39 InformationManager * manager;
40 std::map<uint64_t, BasicBlock*> _blocks;
41 };
42
43 #endif