1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef ABSTRACTDEBUGGER_H
6#define ABSTRACTDEBUGGER_H
7
8#include <QObject>
9
10class AbstractDebugger : public QObject
11{
12 Q_OBJECT
13public:
14 explicit AbstractDebugger(QObject *parent = nullptr);
15
16public:
17 enum RunState
18 {
19 kNoRun,
20 kPreparing, // e.g. build preparation
21 kStart,
22 kRunning,
23 kStopped,
24 kCustomRunning
25 };
26 virtual ~AbstractDebugger(){}
27
28 virtual QWidget *getOutputPane() const = 0;
29 virtual QWidget *getStackPane() const = 0;
30 virtual QWidget *getLocalsPane() const = 0;
31 virtual QWidget *getBreakpointPane() const = 0;
32
33 virtual void startDebug() = 0;
34 virtual void detachDebug() = 0;
35
36 virtual void interruptDebug() = 0;
37 virtual void continueDebug() = 0;
38 virtual void abortDebug() = 0;
39 virtual void restartDebug() = 0;
40
41 virtual void stepOver() = 0;
42 virtual void stepIn() = 0;
43 virtual void stepOut() = 0;
44
45 virtual RunState getRunState() const = 0;
46 virtual bool runCoredump(const QString &target, const QString &core, const QString &kit) = 0;
47
48signals:
49 void runStateChanged(RunState state);
50};
51
52#endif // ABSTRACTDEBUGGER_H
53