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