-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.cpp
More file actions
78 lines (60 loc) · 1.22 KB
/
Copy pathApp.cpp
File metadata and controls
78 lines (60 loc) · 1.22 KB
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
71
72
73
74
75
76
//
// Created by w4264 on 2021/1/8.
//
#include "App.h"
#include <memory>
#include "LLDBCore.h"
static void log(const char *msg, void *)
{
app()->i(QString("LLDB log: %1").arg(msg));
}
App* App::get()
{
static App app;
return &app;
}
App::App()
: m_debugger(lldb::SBDebugger::Create(true, &log, nullptr))
{
}
App::~App()
{
lldb::SBDebugger::Destroy(m_debugger);
}
void App::logError(const QString& msg)
{
emit outputMsg(msg, Qt::red);
}
void App::logWarn(const QString& msg)
{
emit outputMsg(msg, Qt::darkYellow);
}
void App::logInfo(const QString& msg)
{
emit outputMsg(msg, Qt::black);
}
void App::resetCore()
{
auto listener = m_debugger.GetListener();
listener.StartListeningForEventClass(
m_debugger,
lldb::SBProcess::GetBroadcasterClassName(),
0xFFFFFFFF);
listener.StartListeningForEventClass(
m_debugger,
lldb::SBTarget::GetBroadcasterClassName(),
0xFFFFFFFF);
listener.StartListeningForEventClass(
m_debugger,
lldb::SBCommandInterpreter::GetBroadcasterClass(),
0xFFFFFFFF);
listener.StartListeningForEventClass(
m_debugger,
lldb::SBThread::GetBroadcasterClassName(),
0xFFFFFFFF);
lldbCore = std::make_unique<LLDBCore>(listener);
}
LLDBCore *App::getDbgCore()
{
return lldbCore.get();
}