-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
47 lines (36 loc) · 1003 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <QApplication>
#include <iostream>
#include "shellfunctions.h"
#include "mainwindow.h"
int main(int argc, char *argv[])
{
if (argc > 1 && (strncmp(argv[1], "--help", 6) == 0 || strncmp(argv[1], "-h", 2) == 0))
{
std::cout << "Usage: Disass [FILE]\nStarts a GDB session in a GUI to debug the selected file.\n";
return 0;
}
QApplication a(argc, argv);
MainWindow w;
QString gdbFound = getShellCommandOutput("which gdb");
if (gdbFound.isEmpty())
{
QMessageBox::critical(nullptr, "GDB not found", "Please install GDB using your package manager.\n\nExiting.");
return 1;
}
else
{
w.show();
}
QDir *configDirectory = new QDir(w.configDirPath);
if (!configDirectory->exists())
{
configDirectory->mkpath(w.configDirPath);
}
else
{
return a.exec();
}
if (!w.checkForArguments(QCoreApplication::arguments()))
w.showWelcome();
return a.exec();
}