-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDebugger.h
More file actions
60 lines (44 loc) · 1.32 KB
/
Debugger.h
File metadata and controls
60 lines (44 loc) · 1.32 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
/*
* Copyright (c) 2024 Quantag IT Solutions GmbH
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <mutex>
#include <unordered_set>
#include "Typedefs.h"
#include "interfaces/iqvm.h"
class Debugger {
public:
Debugger(const EventHandler&);
~Debugger();
// run() instructs the debugger to continue execution.
void continueDebugger();
int launch(int isRun, const std::string& fileName, const std::string& sessionId, LaunchStatus& status);
// pause() instructs the debugger to pause execution.
void pause();
// currentLine() returns the currently executing line number.
int64_t currentLine();
// stepForward() instructs the debugger to step forward one line.
double stepForward();
// clearBreakpoints() clears all set breakpoints.
void clearBreakpoints();
// addBreakpoint() sets a new breakpoint on the given line.
void addBreakpoint(int64_t line);
// Total number of newlines in source.
int64_t numSourceLines;
std::vector<complexNumber> getQVMVariables();
virtual size_t getQubitsCount() const;
IQVM* getQVM() {
return qvm;
}
std::string getLastErrorMessage() {
return qvm->_errorMessage;
}
private:
EventHandler onEvent;
std::mutex mutex;
std::unordered_set<int64_t> breakpoints;
IQVM* qvm;
};