| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef MINIDUMPRUNCONTROL_H |
| 6 | #define MINIDUMPRUNCONTROL_H |
| 7 | |
| 8 | #include <QObject> |
| 9 | #include <QProcess> |
| 10 | |
| 11 | namespace ReverseDebugger { |
| 12 | namespace Internal { |
| 13 | |
| 14 | enum StopResult { |
| 15 | StoppedSynchronously, // Stopped. |
| 16 | AsynchronousStop // Stop sequence has been started |
| 17 | }; |
| 18 | |
| 19 | class MinidumpRunControl : public QObject |
| 20 | { |
| 21 | Q_OBJECT |
| 22 | |
| 23 | public: |
| 24 | explicit MinidumpRunControl(QObject *obj); |
| 25 | ~MinidumpRunControl(); |
| 26 | |
| 27 | void start(const QString ¶ms, const QString &target); |
| 28 | StopResult stop(); |
| 29 | bool isRunning() const; |
| 30 | QString displayName() const; |
| 31 | |
| 32 | private: |
| 33 | void appendMessage(const QString &msg); |
| 34 | |
| 35 | QProcess *process = nullptr; |
| 36 | QString execFile; |
| 37 | |
| 38 | private slots: |
| 39 | void onStraceExit(int, QProcess::ExitStatus); |
| 40 | |
| 41 | }; |
| 42 | |
| 43 | } // namespace Internal |
| 44 | } // namespace ReverseDebugger |
| 45 | |
| 46 | #endif // MINIDUMPRUNCONTROL_H |
| 47 |