-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLldbDebugger.h
52 lines (43 loc) · 1.24 KB
/
LldbDebugger.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
#pragma once
#include <lldb/API/LLDB.h>
#include <string>
#include <vector>
namespace visual_lldb {
class CodeLocation {
public:
explicit CodeLocation(std::string &&directory, std::string &&fileName,
size_t lineNumber)
: directory(std::move(directory)), fileName(std::move(fileName)),
lineNumber(lineNumber) {}
const std::string &getDirectory() const;
const std::string &getFileName() const;
size_t getLine() const;
private:
const std::string directory, fileName;
size_t lineNumber;
};
class LldbDebugger {
public:
explicit LldbDebugger(const std::string &targetPath);
LldbDebugger(const LldbDebugger &) = delete;
LldbDebugger &operator=(const LldbDebugger &) = delete;
virtual ~LldbDebugger();
void run();
void resume();
void next();
void stepUp();
void stepDown();
void toggleBreakpoint(const std::string &fileName, size_t lineNumber);
CodeLocation getLocation() const;
std::vector<lldb::SBBreakpoint> &getBreakpoints();
lldb::SBValueList getFrameVariables();
bool isActive();
private:
void waitForStop();
bool isStopped();
lldb::SBDebugger debugger;
lldb::SBTarget target;
lldb::SBProcess process;
std::vector<lldb::SBBreakpoint> bps;
};
} // namespace visual_lldb