#include "qt.hxx"
#include "disassembler/Disassembler.hxx"
+#include "core/events/NewFunctionEvent.hxx"
+
class Interpreter;
class Function;
class InformationManager : public QObject {
#ifndef SWIG
Q_OBJECT
-Q_SIGNALS:
+signals:
#else
public:
#endif
void renameFunctionEvent(RenameFunctionEvent* event);
- void newFunctionEvent(NewFunctionEvent* event);
+ void newFunctionEvent(NewFunctionEvent event);
void changeCommentEvent(ChangeCommentEvent* event);
- void reset();
+ void resetEvent();
public:
InformationManager();
~InformationManager();
+ // Start working on a fresh binary
void reset(const std::string& filename);
+
+ // Load a saved binary
void load(const std::string& filename);
+
+ // Save current state to disk
void save(const std::string& filename);
Disassembler* getDisassembler()
{ return disassembler.get(); }
// Accessors
- Function* getFunction(uint64_t address);
+ /* Used by the disassembler to determine whether to use unsafe
+ * heuristics for finding an entry point
+ */
bool hasFunctions() const {return functions.size() != 0;}
+
+ uint64_t getEntryAddress() {return disassembler->entryAddress();}
+
+ Function* getFunction(uint64_t address);
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();
std::multimap<uint64_t, Comment*>::const_iterator,
std::multimap<uint64_t, Comment*>::const_iterator>
getComments(uint64_t address);
- bool hasComments() const {return ! comments.empty();}
std::multimap<uint64_t,Comment*>::const_iterator beginComments();
std::multimap<uint64_t,Comment*>::const_iterator endComments();
std::unique_ptr<QTemporaryFile> tmpfile;
std::vector<QPluginLoader*> plugins;
+ QThread disassemblerThread;
log4cxx::LoggerPtr logger;
};