X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fmain.cxx;h=0c1ffe50a750e82b8f848b29db742cb8d91772ed;hp=80e06cea3fe324195a01415ed4af18537d3741aa;hb=9e283567ac56a6433e832d0fa38cf534a0cb8f9f;hpb=516e590392ed1f4ead816731bfd95fc3c4690b9f diff --git a/src/main.cxx b/src/main.cxx index 80e06ce..0c1ffe5 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -1,16 +1,24 @@ -#include "include_llvm.hxx" +#include "disassembler/llvm/include_llvm.hxx" #include #include #include +#if QT_VERSION > QT_VERSION_CHECK(5, 2, 0) +#define ARGPARSE +#endif + +#ifdef ARGPARSE #include +#endif #include #include "log4cxx/logger.h" #include "log4cxx/basicconfigurator.h" #include "gui/Mainwindow.hxx" +#include "core/InformationManager.hxx" +#include "disassembler/llvm/LLVMDisassembler.hxx" using std::cout; using std::cin; @@ -20,35 +28,41 @@ int main(int argc, char** argv) { QApplication app(argc, argv); - log4cxx::BasicConfigurator::configure(); - log4cxx::LoggerPtr _logger(log4cxx::Logger::getLogger("main")); + log4cxx::BasicConfigurator::configure(); + log4cxx::LoggerPtr _logger(log4cxx::Logger::getLogger("main")); +#ifdef ARGPARSE QCommandLineParser parser; +#endif QApplication::setApplicationName("frida"); +#ifdef ARGPARSE parser.addHelpOption(); parser.addVersionOption(); parser.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble.")); - parser.process(app); +#endif + + InformationManager iman; - LOG4CXX_DEBUG(_logger, "Initializing LLVM"); - llvm::InitializeAllTargetInfos(); - llvm::InitializeAllTargetMCs(); - llvm::InitializeAllAsmParsers(); - llvm::InitializeAllDisassemblers(); + LOG4CXX_DEBUG(_logger, "Initializing LLVM"); + llvm::InitializeAllTargetInfos(); + llvm::InitializeAllTargetMCs(); + llvm::InitializeAllAsmParsers(); + llvm::InitializeAllDisassemblers(); - LOG4CXX_DEBUG(_logger, "Initializing Qt"); + LOG4CXX_DEBUG(_logger, "Initializing Qt"); - std::string filename; - if (parser.positionalArguments().isEmpty()) { - filename = ""; - } else { + std::string filename = ""; +#ifdef ARGPARSE + if (! parser.positionalArguments().isEmpty()) { filename = parser.positionalArguments().at(0).toStdString(); } +#endif - Mainwindow m(filename); + Mainwindow m(&iman); m.show(); + iman.reset(filename); return app.exec(); }