X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FBasicBlock.hxx;fp=src%2Fcore%2FBasicBlock.hxx;h=b3e5a89d819cfbd74c5b375919eba6dcccd7e09a;hp=0000000000000000000000000000000000000000;hb=32e87746db981882b95aceddde79ef12034a3405;hpb=bc07dbf3889f93f65c4b73f911aa280afdd906fb diff --git a/src/core/BasicBlock.hxx b/src/core/BasicBlock.hxx new file mode 100644 index 0000000..b3e5a89 --- /dev/null +++ b/src/core/BasicBlock.hxx @@ -0,0 +1,54 @@ +#ifndef INCLUDE__BasicBlock_hxx +#define INCLUDE__BasicBlock_hxx + +#include +#include +#include + +class BasicBlock { +public: + BasicBlock() { + next_blocks[0] = 0; + next_blocks[1] = 0; + } + + uint64_t getStartAddress() const { + return start_address; + } + + uint64_t getEndAddress() const { + return end_address; + } + + uint64_t getNextBlock(size_t index) const { + assert(index < 2); + return next_blocks[index]; + } + + void setNextBlock(size_t index, uint64_t address) { + assert(index < 2); + next_blocks[index] = address; + } + + void setStartAddress(uint64_t address) { + start_address = address; + } + + void setEndAddress(uint64_t address) { + end_address = address; + } + + std::string getName() { + std::stringstream s; + s << "BLOCK_" << std::hex << start_address << '_' << end_address; + return s.str(); + } + +private: + uint64_t start_address; + uint64_t end_address; + + uint64_t next_blocks[2]; +}; + +#endif