1 #include "disassembler/llvm/include_llvm.hxx"
6 #include <QApplication>
7 #if QT_VERSION > QT_VERSION_CHECK(5, 2, 0)
12 #include <QCommandLineParser>
16 #include "log4cxx/logger.h"
17 #include "log4cxx/basicconfigurator.h"
19 #include "gui/Mainwindow.hxx"
25 int main(int argc
, char** argv
)
27 QApplication
app(argc
, argv
);
29 log4cxx::BasicConfigurator::configure();
30 log4cxx::LoggerPtr
_logger(log4cxx::Logger::getLogger("main"));
33 QCommandLineParser parser
;
36 QApplication::setApplicationName("frida");
38 parser
.addHelpOption();
39 parser
.addVersionOption();
40 parser
.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble."));
46 LOG4CXX_DEBUG(_logger
, "Initializing LLVM");
47 llvm::InitializeAllTargetInfos();
48 llvm::InitializeAllTargetMCs();
49 llvm::InitializeAllAsmParsers();
50 llvm::InitializeAllDisassemblers();
52 LOG4CXX_DEBUG(_logger
, "Initializing Qt");
54 std::string filename
= "";
56 if (! parser
.positionalArguments().isEmpty()) {
57 filename
= parser
.positionalArguments().at(0).toStdString();
61 Mainwindow
m(filename
);