X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FInformationManager.cxx;h=61daa3d269d094dc130ae80e82d51f3ac9871a89;hp=fd0715b851adfe927601fe50aa0bc5ef9e552485;hb=3d7b4d3a5f6c17823bb79490256661ddb5e7ab83;hpb=11fd69cdfce58707599bf57c07c5a784905e23f6 diff --git a/src/core/InformationManager.cxx b/src/core/InformationManager.cxx index fd0715b..61daa3d 100644 --- a/src/core/InformationManager.cxx +++ b/src/core/InformationManager.cxx @@ -10,9 +10,13 @@ #include +InformationManager* current_information_manager; + InformationManager::InformationManager() - : logger(log4cxx::Logger::getLogger("InformationManager")) -{} + : logger(log4cxx::Logger::getLogger("core.InformationManager")) +{ + current_information_manager = this; +} InformationManager::~InformationManager() { for (auto b : blocks) @@ -108,6 +112,12 @@ void InformationManager::save(const std::string& filename) { void InformationManager::signal_new_function(Function* fun) { } + + +/* ******************************* + * Accessors for the Functions map + */ + Function* InformationManager::getFunction(uint64_t address) { auto it = functions.find(address); if (it != functions.end()) @@ -116,6 +126,18 @@ Function* InformationManager::getFunction(uint64_t address) { return NULL; } +std::map::const_iterator InformationManager::beginFunctions() { + return functions.begin(); +} +std::map::const_iterator InformationManager::endFunctions() { + return functions.end(); +} + + +/* ********************************* + * Accessors for the BasicBlocks map + */ + BasicBlock* InformationManager::getBasicBlock(uint64_t address) { auto it = blocks.find(address); if (it != blocks.end()) @@ -124,6 +146,19 @@ BasicBlock* InformationManager::getBasicBlock(uint64_t address) { return NULL; } +std::map::const_iterator InformationManager::beginBasicBlocks() { + return blocks.begin(); +} +std::map::const_iterator InformationManager::endBasicBlocks() { + return blocks.end(); +} + + + +/* ******************************** + * Factory methods for data classes + */ + Function* InformationManager::newFunction(uint64_t address) { Function* fun = new Function(address, this); functions.insert(std::make_pair(address, fun));