X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fmain.cxx;h=9e25c20597b8f9df0ae5cdb81b9e063d3ae6341d;hp=0c1ffe50a750e82b8f848b29db742cb8d91772ed;hb=82b40a653fb3a1d349e32679340f276d5c61d269;hpb=9e283567ac56a6433e832d0fa38cf534a0cb8f9f diff --git a/src/main.cxx b/src/main.cxx index 0c1ffe5..9e25c20 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -1,6 +1,5 @@ #include "disassembler/llvm/include_llvm.hxx" -#include #include #include @@ -12,17 +11,17 @@ #include #endif #include +#include +#include #include "log4cxx/logger.h" #include "log4cxx/basicconfigurator.h" #include "gui/Mainwindow.hxx" #include "core/InformationManager.hxx" +#include "core/Settings.hxx" #include "disassembler/llvm/LLVMDisassembler.hxx" - -using std::cout; -using std::cin; -using std::cerr; +#include "Config.hxx" int main(int argc, char** argv) { @@ -36,14 +35,43 @@ int main(int argc, char** argv) #endif QApplication::setApplicationName("frida"); + QApplication::setApplicationVersion("0.2+"); + QApplication::addLibraryPath(CONFIG_LIBDIR "/frida/plugins/Interpreter"); + qRegisterMetaType >("QVector"); #ifdef ARGPARSE parser.addHelpOption(); parser.addVersionOption(); + + QCommandLineOption loglevelOption("loglevel", "Control verbosity of logging", "FATAL|ERROR|WARN|INFO|DEBUG|TRACE"); + loglevelOption.setDefaultValue("INFO"); + parser.addOption(loglevelOption); + parser.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble.")); parser.process(app); #endif + log4cxx::LevelPtr level = log4cxx::Level::getInfo(); +#ifdef ARGPARSE + if (parser.value(loglevelOption) != "") { + std::string levelstring = parser.value(loglevelOption).toStdString(); + if (levelstring == "FATAL") + level = log4cxx::Level::getFatal(); + if (levelstring == "ERROR") + level = log4cxx::Level::getError(); + if (levelstring == "WARN") + level = log4cxx::Level::getWarn(); + if (levelstring == "INFO") + level = log4cxx::Level::getInfo(); + if (levelstring == "DEBUG") + level = log4cxx::Level::getDebug(); + if (levelstring == "TRACE") + level = log4cxx::Level::getTrace(); + } +#endif + log4cxx::Logger::getRootLogger()->setLevel(level); + + Settings settings; InformationManager iman; LOG4CXX_DEBUG(_logger, "Initializing LLVM");