1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef REVERSEDEBUGGERMGR_H |
6 | #define REVERSEDEBUGGERMGR_H |
7 | |
8 | #include <QObject> |
9 | |
10 | class QSettings; |
11 | namespace ReverseDebugger { |
12 | namespace Internal { |
13 | |
14 | class MinidumpRunControl; |
15 | class ReverseDebuggerMgr : public QObject |
16 | { |
17 | Q_OBJECT |
18 | public: |
19 | explicit ReverseDebuggerMgr(QObject *parent = nullptr); |
20 | |
21 | void initialize(); |
22 | |
23 | void recored(); |
24 | void replay(); |
25 | |
26 | QWidget *getWidget() const; |
27 | |
28 | signals: |
29 | |
30 | private slots: |
31 | void recordMinidump(); |
32 | void runCoredump(int index); |
33 | void unloadMinidump(); |
34 | |
35 | private: |
36 | QVariant configValue(const QByteArray &name); |
37 | void setConfigValue(const QByteArray &name, const QVariant &value); |
38 | QString generateFilePath(const QString &fileName, const QString &traceDir, int pid); |
39 | bool replayMinidump(const QString &traceDir, int pid); |
40 | void outputMessage(const QString &msg); |
41 | void exist(); |
42 | const QString &dumpTargetPath() const; |
43 | QString projectTargetPath() const; |
44 | void enterReplayEnvironment(); |
45 | |
46 | MinidumpRunControl *runCtrl = nullptr; |
47 | QSettings *settings = nullptr; |
48 | QString targetPath; |
49 | }; |
50 | |
51 | } // namespace Internal |
52 | } // namespace ReverseDebugger |
53 | |
54 | #endif // REVERSEDEBUGGERMGR_H |
55 |