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
11namespace ReverseDebugger {
12namespace Internal {
13
14enum StopResult {
15 StoppedSynchronously, // Stopped.
16 AsynchronousStop // Stop sequence has been started
17};
18
19class MinidumpRunControl : public QObject
20{
21 Q_OBJECT
22
23public:
24 explicit MinidumpRunControl(QObject *obj);
25 ~MinidumpRunControl();
26
27 void start(const QString &params, const QString &target);
28 StopResult stop();
29 bool isRunning() const;
30 QString displayName() const;
31
32private:
33 void appendMessage(const QString &msg);
34
35 QProcess *process = nullptr;
36 QString execFile;
37
38private slots:
39 void onStraceExit(int, QProcess::ExitStatus);
40
41};
42
43} // namespace Internal
44} // namespace ReverseDebugger
45
46#endif // MINIDUMPRUNCONTROL_H
47