1 #include "disassembler/llvm/include_llvm.hxx"
5 #include <QApplication>
6 #if QT_VERSION > QT_VERSION_CHECK(5, 2, 0)
11 #include <QCommandLineParser>
15 #include "log4cxx/logger.h"
16 #include "log4cxx/basicconfigurator.h"
18 #include "gui/Mainwindow.hxx"
19 #include "core/InformationManager.hxx"
20 #include "disassembler/llvm/LLVMDisassembler.hxx"
22 int main(int argc
, char** argv
)
24 QApplication
app(argc
, argv
);
26 log4cxx::BasicConfigurator::configure();
27 log4cxx::LoggerPtr
_logger(log4cxx::Logger::getLogger("main"));
30 QCommandLineParser parser
;
33 QApplication::setApplicationName("frida");
35 parser
.addHelpOption();
36 parser
.addVersionOption();
37 parser
.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble."));
42 InformationManager iman
;
44 LOG4CXX_DEBUG(_logger
, "Initializing LLVM");
45 llvm::InitializeAllTargetInfos();
46 llvm::InitializeAllTargetMCs();
47 llvm::InitializeAllAsmParsers();
48 llvm::InitializeAllDisassemblers();
50 LOG4CXX_DEBUG(_logger
, "Initializing Qt");
52 std::string filename
= "";
54 if (! parser
.positionalArguments().isEmpty()) {
55 filename
= parser
.positionalArguments().at(0).toStdString();