]> git.siccegge.de Git - frida/frida.git/commitdiff
Complete accessors for InformationManager managed objects
authorChristoph Egger <Christoph.Egger@cs.fau.de>
Thu, 12 Mar 2015 12:45:41 +0000 (13:45 +0100)
committerChristoph Egger <Christoph.Egger@cs.fau.de>
Thu, 12 Mar 2015 12:45:41 +0000 (13:45 +0100)
src/core/InformationManager.cxx
src/core/InformationManager.hxx

index 711d47a552cb466b78b5c69a49d86e0d89ec9741..61daa3d269d094dc130ae80e82d51f3ac9871a89 100644 (file)
@@ -112,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())
@@ -120,6 +126,18 @@ Function* InformationManager::getFunction(uint64_t address) {
                return NULL;
 }
 
+std::map<uint64_t, Function*>::const_iterator InformationManager::beginFunctions() {
+       return functions.begin();
+}
+std::map<uint64_t, Function*>::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())
@@ -128,6 +146,19 @@ BasicBlock* InformationManager::getBasicBlock(uint64_t address) {
                return NULL;
 }
 
+std::map<uint64_t, BasicBlock*>::const_iterator InformationManager::beginBasicBlocks() {
+       return blocks.begin();
+}
+std::map<uint64_t, BasicBlock*>::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));
index 86e4d8cd80039fbe0b4c3fc43205a4b5d41585f0..555070abefd624cf6e19a5b84218a58ab3b73097 100644 (file)
@@ -13,11 +13,11 @@ class Function;
 class BasicBlock;
 class Comment;
 
+class RenameFunctionEvent;
+
 class QString;
 class QTemporaryFile;
 
-class RenameFunctionEvent;
-
 class InformationManager {
 public:
        InformationManager();
@@ -53,9 +53,17 @@ public:
        void dispatch(RenameFunctionEvent* event)
                { rename_function_signal(event); }
 
+
        Function* getFunction(uint64_t address);
-       BasicBlock* getBasicBlock(uint64_t address);
        bool hasFunctions() const {return functions.size() != 0;}
+       std::map<uint64_t, Function*>::const_iterator beginFunctions();
+       std::map<uint64_t, Function*>::const_iterator endFunctions();
+
+       BasicBlock* getBasicBlock(uint64_t address);
+       bool hasBasicBlocks() const {return blocks.size() != 0;}
+       std::map<uint64_t, BasicBlock*>::const_iterator beginBasicBlocks();
+       std::map<uint64_t, BasicBlock*>::const_iterator endBasicBlocks();
+
 
        /* Protocoll:
         *