X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FInformationManager.cxx;fp=src%2Fcore%2FInformationManager.cxx;h=8834a7a39f479b49a0d9b9dad115eaf7269d33cc;hp=e1571892349336ab5d0cc94f1d64104d64428d68;hb=d1b23c7274d6430ccc70bf2baf616437db9f5706;hpb=1ef802ee9a14e6274b3e60db873965b794f49abe diff --git a/src/core/InformationManager.cxx b/src/core/InformationManager.cxx index e157189..8834a7a 100644 --- a/src/core/InformationManager.cxx +++ b/src/core/InformationManager.cxx @@ -5,6 +5,7 @@ #include "core/BasicBlock.hxx" #include "core/Comment.hxx" #include "core/events/NewFunctionEvent.hxx" +#include "core/events/ChangeCommentEvent.hxx" #include "gui/qt.hxx" #include @@ -160,6 +161,22 @@ std::map::const_iterator InformationManager::endBasicBloc return blocks.end(); } +/* ********************************* + * Accessors for the Comments map + */ +std::pair< + std::multimap::const_iterator, + std::multimap::const_iterator> +InformationManager::getComments(uint64_t address) { + return comments.equal_range(address); +} + +std::multimap::const_iterator InformationManager::beginComments() { + return comments.begin(); +} +std::multimap::const_iterator InformationManager::endComments() { + return comments.end(); +} /* ********************************* * Accessors for the Interpreter map @@ -210,7 +227,7 @@ Comment* InformationManager::newGlobalComment(uint64_t address) { } Comment* InformationManager::newLocalComment(uint64_t address, Function* f) { - Comment* comment = new Comment(address, this); + Comment* comment = new Comment(address, f, this); comments.insert(std::make_pair(address, comment)); return comment; } @@ -228,7 +245,10 @@ void InformationManager::finishFunction(Function* fun) { void InformationManager::finishBasicBlock(BasicBlock*) { } -void InformationManager::finnishComment(Comment* c) { +void InformationManager::finishComment(Comment* c) { + LOG4CXX_DEBUG(logger, "Finishing comment " << c->getAddress()); + ChangeCommentEvent event(c->getAddress(), c->getLocation(), c); + dispatch(&event); } void InformationManager::deleteFunction(Function* f) {