]> git.siccegge.de Git - frida/frida.git/blob - src/core/Function.hxx
constify function in Function
[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 void setName(const std::string& new_name)
24 { name = new_name; }
25
26 InformationManager* getManager() const {
27 return manager;
28 }
29
30 void addBasicBlock(BasicBlock* block) {
31 _blocks.insert(std::make_pair(block->getStartAddress(), block));
32 }
33
34 const std::map<uint64_t, BasicBlock*>& blocks() {
35 return _blocks;
36 }
37 private:
38 std::string name;
39 uint64_t start_address;
40 InformationManager * manager;
41 std::map<uint64_t, BasicBlock*> _blocks;
42 };
43
44 #endif