X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fcore%2FInformationManager.hxx;h=23645440a1e05760abecbf40f0d6587ca66aff81;hp=555070abefd624cf6e19a5b84218a58ab3b73097;hb=1b43b26ba9b23cb5f3004db7b9b00f6b08227563;hpb=3d7b4d3a5f6c17823bb79490256661ddb5e7ab83 diff --git a/src/core/InformationManager.hxx b/src/core/InformationManager.hxx index 555070a..2364544 100644 --- a/src/core/InformationManager.hxx +++ b/src/core/InformationManager.hxx @@ -2,23 +2,40 @@ #define INCLUDE__InformationManager_hxx #include -#include #include #include #include +#include +#include +#include "qt.hxx" #include "disassembler/Disassembler.hxx" +class Interpreter; + class Function; class BasicBlock; class Comment; class RenameFunctionEvent; +class NewFunctionEvent; +class ChangeCommentEvent; class QString; class QTemporaryFile; +class QPluginLoader; -class InformationManager { +class InformationManager : public QObject { +#ifndef SWIG + Q_OBJECT +Q_SIGNALS: +#else +public: +#endif + void renameFunctionEvent(RenameFunctionEvent* event); + void newFunctionEvent(NewFunctionEvent* event); + void changeCommentEvent(ChangeCommentEvent* event); + void reset(); public: InformationManager(); ~InformationManager(); @@ -27,33 +44,10 @@ public: void load(const std::string& filename); void save(const std::string& filename); - void signal_new_function(Function* f); - void signal_new_dyn_symbol(const std::string& f) - { new_dyn_symbol_signal(f); } - - boost::signals2::connection - connect_new_function_signal(std::function f) - { return new_function_signal.connect(f); } - - boost::signals2::connection - connect_new_dyn_symbol_signal(std::function f) - { return new_dyn_symbol_signal.connect(f); } - - boost::signals2::connection - connect_reset_signal(std::function f) - { return reset_signal.connect(f); } - - boost::signals2::connection - connect_rename_function_signal(std::function f) - { return rename_function_signal.connect(f); } - Disassembler* getDisassembler() { return disassembler.get(); } - void dispatch(RenameFunctionEvent* event) - { rename_function_signal(event); } - - + // Accessors Function* getFunction(uint64_t address); bool hasFunctions() const {return functions.size() != 0;} std::map::const_iterator beginFunctions(); @@ -64,6 +58,18 @@ public: std::map::const_iterator beginBasicBlocks(); std::map::const_iterator endBasicBlocks(); + std::pair< + std::multimap::const_iterator, + std::multimap::const_iterator> + getComments(uint64_t address); + bool hasComments() const {return ! comments.empty();} + std::multimap::const_iterator beginComments(); + std::multimap::const_iterator endComments(); + + Interpreter* getInterpreter(const std::string& name); + bool hasInterpreters() const {return interpreters.size() != 0;} + std::map::const_iterator beginInterpreters(); + std::map::const_iterator endInterpreters(); /* Protocoll: * @@ -85,26 +91,28 @@ public: * thingsmay happen. */ Function* newFunction(uint64_t address); + Function* newDynamicFunction(uint64_t address); BasicBlock* newBasicBlock(uint64_t address); Comment* newGlobalComment(uint64_t address); Comment* newLocalComment(uint64_t address, Function* f); void finishFunction(Function* f); void finishBasicBlock(BasicBlock* b); - void finnishComment(Comment* c); + void finishComment(Comment* c); void deleteFunction(Function* f); void deleteBasicBlock(BasicBlock* b); void deleteComment(Comment* c); private: - boost::signals2::signal reset_signal; - boost::signals2::signal new_function_signal; - boost::signals2::signal new_dyn_symbol_signal; - boost::signals2::signal rename_function_signal; std::unique_ptr disassembler; + + std::map interpreters; std::map functions; std::map blocks; + std::multimap comments; + std::string filename; std::unique_ptr tmpfile; + std::vector plugins; log4cxx::LoggerPtr logger; };