-
Notifications
You must be signed in to change notification settings - Fork 2
/
LLDBCore.h
65 lines (47 loc) · 1.34 KB
/
LLDBCore.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
//
// Created by w4264 on 2021/1/8.
//
#pragma once
#include <QThread>
#include <memory>
#include <lldb/API/LLDB.h>
#include <vector>
struct LaunchInfo
{
QString exePath;
QString workingDir;
QString stdoutPath;
QString stderrPath;
QString stdinPath;
QStringList argList;
QStringList envList;
uint32_t launchFlags;
};
class LLDBCore: public QThread
{
Q_OBJECT
public:
explicit LLDBCore(const lldb::SBListener& listener);
~LLDBCore() override;
static bool init();
std::vector<std::pair<QString, QString>> platforms();
bool launch(QString const &exePath, QString const &workingDir, QString const &stdoutPath,
QString const &stderrPath, QString const &stdinPath, QStringList const &argList,
QStringList const &envList, uint32_t launchFlags);
bool launch(const LaunchInfo& launchInfo);
bool attach(uint64_t pid);
LaunchInfo const& getLaunchInfo() const { return m_launchInfo; }
lldb::SBProcess const &getProcess() const { return m_process; }
lldb::SBProcess &getProcess() { return m_process; }
lldb::SBTarget const &getTarget() const { return m_target; }
lldb::SBTarget &getTarget() { return m_target; }
protected:
void run() override;
private:
static std::unique_ptr<LLDBCore> instance;
LaunchInfo m_launchInfo;
lldb::SBListener m_listener;
lldb::SBTarget m_target;
lldb::SBProcess m_process;
lldb::SBEvent m_event;
};