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"
20 #include "core/InformationManager.hxx"
21 #include "disassembler/llvm/LLVMDisassembler.hxx"
27 int main(int argc
, char** argv
)
29 QApplication
app(argc
, argv
);
31 log4cxx::BasicConfigurator::configure();
32 log4cxx::LoggerPtr
_logger(log4cxx::Logger::getLogger("main"));
35 QCommandLineParser parser
;
38 QApplication::setApplicationName("frida");
40 parser
.addHelpOption();
41 parser
.addVersionOption();
42 parser
.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble."));
47 InformationManager iman
;
49 LOG4CXX_DEBUG(_logger
, "Initializing LLVM");
50 llvm::InitializeAllTargetInfos();
51 llvm::InitializeAllTargetMCs();
52 llvm::InitializeAllAsmParsers();
53 llvm::InitializeAllDisassemblers();
55 LOG4CXX_DEBUG(_logger
, "Initializing Qt");
57 std::string filename
= "";
59 if (! parser
.positionalArguments().isEmpty()) {
60 filename
= parser
.positionalArguments().at(0).toStdString();