1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef DEBUGSERVICE_H |
6 | #define DEBUGSERVICE_H |
7 | |
8 | #include "debug.h" |
9 | #include "debugsession.h" |
10 | |
11 | #include <QObject> |
12 | #include <QSharedPointer> |
13 | |
14 | namespace DEBUG_NAMESPACE { |
15 | |
16 | class DebugModel; |
17 | class DebugService : public QObject |
18 | { |
19 | Q_OBJECT |
20 | public: |
21 | explicit DebugService(QObject *parent = nullptr); |
22 | |
23 | void sendAllBreakpoints(DebugSession *session); |
24 | dap::array<IBreakpoint> addBreakpoints(QUrl uri, dap::array<IBreakpointData> rawBreakpoints, |
25 | dap::optional<DebugSession *> session); |
26 | |
27 | dap::array<IBreakpoint> removeBreakpoints(const QString &filePath, int lineNumber, |
28 | dap::optional<DebugSession *> session); |
29 | |
30 | DebugModel *getModel() const; |
31 | |
32 | signals: |
33 | |
34 | public slots: |
35 | |
36 | private: |
37 | void sendBreakpoints(dap::optional<QUrl> uri, DebugSession *session, bool sourceModified = false); |
38 | void sendFunctionBreakpoints(DebugSession *session); |
39 | void sendDataBreakpoints(DebugSession *session); |
40 | void sendInstructionBreakpoints(DebugSession *session); |
41 | void sendExceptionBreakpoints(DebugSession *session); |
42 | |
43 | QSharedPointer<DebugModel> model; |
44 | }; |
45 | |
46 | } // end namespace. |
47 | |
48 | #endif // DEBUGSERVICE_H |
49 |