]> git.siccegge.de Git - frida/frida.git/blob - src/core/Function.hxx
Name functions in BasicBlock view
[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, InformationManager* manager);
12
13 uint64_t getStartAddress() const {
14 return start_address;
15 }
16
17 std::string getName() const
18 { return name; }
19 void setName(const std::string& new_name);
20
21 InformationManager* getManager() const {
22 return manager;
23 }
24
25 void addBasicBlock(BasicBlock* block) {
26 _blocks.insert(std::make_pair(block->getStartAddress(), block));
27 }
28
29 const std::map<uint64_t, BasicBlock*>& blocks() {
30 return _blocks;
31 }
32 private:
33 std::string name;
34 uint64_t start_address;
35 InformationManager * manager;
36 std::map<uint64_t, BasicBlock*> _blocks;
37 };
38
39 #endif