-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.h
71 lines (54 loc) · 1.7 KB
/
App.h
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// Created by w4264 on 2021/1/8.
//
#pragma once
#include <QObject>
#include <QColor>
#include <memory>
#include <lldb/API/LLDB.h>
class LLDBCore;
class App: public QObject
{
Q_OBJECT
public:
~App() override;
static App *get();
void logError(QString const &msg);
void logWarn(QString const &msg);
void logInfo(QString const &msg);
void i(QString const &msg) { logInfo(msg); }
void w(QString const &msg) { logWarn(msg); }
void e(QString const &msg) { logError(msg); }
void resetCore();
lldb::SBDebugger const& getDebugger() const {return m_debugger;}
lldb::SBDebugger& getDebugger() {return m_debugger;}
LLDBCore *getDbgCore();
void setExecutable(QString const& fileName) { m_executable = fileName; }
QString const& getExecutable() const { return m_executable; }
void setModule(QString const& fileName) { m_module = fileName; }
QString const& getModule() const { return m_module; }
void setProcessId(uint64_t tid) { m_processId = tid; }
uint64_t getProcessId() const { return m_processId; }
void setThreadId(uint64_t tid) { m_threadId = tid; }
uint64_t getThreadId() const { return m_threadId; }
signals:
void outputMsg(QString const &msg, QColor const &color);
void debugeeExited(int status);
void onStopState();
void onThreadFrameChanged(uint64_t tid, int index);
void gotoMemory(uint64_t address);
void onModulesChange();
void onBreakpointChange();
void openSourceFile(QString const& path);
void updateTitle();
private:
App();
QString m_executable;
QString m_module;
uint64_t m_processId = 0;
uint64_t m_threadId = 0;
lldb::SBDebugger m_debugger;
std::unique_ptr<LLDBCore> lldbCore;
};
inline App *app() { return App::get(); }
inline LLDBCore *core() { return app()->getDbgCore(); }