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