Changeset View
Changeset View
Standalone View
Standalone View
debuggers/common/midebugjobs.h
- This file was moved from debuggers/gdb/debugjob.h.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * GDB Debugger Support | 2 | * Common Code for Debugger Support | ||
3 | * | 3 | * | ||
4 | * Copyright 2006 Vladimir Prus <ghost@cs.msu.su> | 4 | * Copyright 2006 Vladimir Prus <ghost@cs.msu.su> | ||
5 | * Copyright 2007 Hamish Rodda <rodda@kde.org> | 5 | * Copyright 2007 Hamish Rodda <rodda@kde.org> | ||
6 | * Copyright 2009 Andreas Pakulat <apaku@gmx.de> | 6 | * Copyright 2009 Andreas Pakulat <apaku@gmx.de> | ||
7 | * Copyright 2016 Aetf <aetf@unlimitedcodeworks.xyz> | ||||
7 | * | 8 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as | 10 | * it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation; either version 2 of the | 11 | * published by the Free Software Foundation; either version 2 of the | ||
11 | * License, or (at your option) any later version. | 12 | * License, or (at your option) any later version. | ||
12 | * | 13 | * | ||
13 | * This program is distributed in the hope that it will be useful, | 14 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | 17 | * GNU General Public License for more details. | ||
17 | * | 18 | * | ||
18 | * You should have received a copy of the GNU General Public | 19 | * You should have received a copy of the GNU General Public | ||
19 | * License along with this program; if not, write to the | 20 | * License along with this program; if not, write to the | ||
20 | * Free Software Foundation, Inc., | 21 | * Free Software Foundation, Inc., | ||
21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
22 | */ | 23 | */ | ||
23 | #ifndef GDBDEBUGJOB | 24 | #ifndef MIDEBUGJOBS_H | ||
24 | #define GDBDEBUGJOB | 25 | #define MIDEBUGJOBS_H | ||
25 | 26 | | |||
26 | #include <outputview/outputjob.h> | 27 | #include <outputview/outputjob.h> | ||
27 | 28 | | |||
28 | class IExecutePlugin; | 29 | class IExecutePlugin; | ||
29 | namespace KDevelop | 30 | namespace KDevelop | ||
30 | { | 31 | { | ||
31 | class OutputModel; | 32 | class OutputModel; | ||
32 | class ILaunchConfiguration; | 33 | class ILaunchConfiguration; | ||
33 | } | 34 | } | ||
34 | 35 | | |||
35 | namespace KDevMI { | 36 | namespace KDevMI { | ||
36 | namespace GDB | | |||
37 | { | | |||
38 | class CppDebuggerPlugin; | | |||
39 | class DebugSession; | | |||
40 | 37 | | |||
38 | class MIDebuggerPlugin; | ||||
39 | class MIDebugSession; | ||||
41 | 40 | | |||
42 | class DebugJob : public KDevelop::OutputJob | 41 | class MIDebugJob : public KDevelop::OutputJob | ||
43 | { | 42 | { | ||
44 | Q_OBJECT | 43 | Q_OBJECT | ||
45 | public: | 44 | public: | ||
46 | DebugJob( CppDebuggerPlugin* p, KDevelop::ILaunchConfiguration* launchcfg, | 45 | MIDebugJob(MIDebuggerPlugin* p, KDevelop::ILaunchConfiguration* launchcfg, IExecutePlugin* plugin, | ||
47 | IExecutePlugin* plugin, QObject* parent = 0 ); | 46 | QObject* parent = 0); | ||
48 | void start() override; | 47 | void start() override; | ||
48 | | ||||
49 | protected: | 49 | protected: | ||
50 | bool doKill() override; | 50 | bool doKill() override; | ||
51 | private slots: | 51 | | ||
52 | private Q_SLOTS: | ||||
52 | void stdoutReceived(const QStringList&); | 53 | void stdoutReceived(const QStringList&); | ||
53 | void stderrReceived(const QStringList&); | 54 | void stderrReceived(const QStringList&); | ||
54 | void done(); | 55 | void done(); | ||
56 | | ||||
55 | private: | 57 | private: | ||
56 | KDevelop::OutputModel* model(); | 58 | KDevelop::OutputModel* model(); | ||
57 | DebugSession* m_session; | 59 | | ||
60 | MIDebugSession* m_session; | ||||
58 | KDevelop::ILaunchConfiguration* m_launchcfg; | 61 | KDevelop::ILaunchConfiguration* m_launchcfg; | ||
59 | IExecutePlugin* m_execute; | 62 | IExecutePlugin* m_execute; | ||
60 | }; | 63 | }; | ||
61 | 64 | | |||
62 | //this job is just here to be able to kill the debug session | 65 | class MIExamineCoreJob : public KJob | ||
63 | class KillSessionJob : public KJob | 66 | { | ||
67 | Q_OBJECT | ||||
68 | public: | ||||
69 | MIExamineCoreJob(MIDebuggerPlugin *plugin, QObject *parent = nullptr); | ||||
70 | | ||||
71 | void start() override; | ||||
72 | | ||||
73 | protected: | ||||
74 | bool doKill() override; | ||||
75 | | ||||
76 | private Q_SLOTS: | ||||
77 | void done(); | ||||
78 | | ||||
79 | private: | ||||
80 | MIDebugSession *m_session; | ||||
81 | }; | ||||
82 | | ||||
83 | class MIAttachProcessJob : public KJob | ||||
64 | { | 84 | { | ||
65 | Q_OBJECT | 85 | Q_OBJECT | ||
66 | public: | 86 | public: | ||
67 | KillSessionJob(DebugSession *session, QObject *parent = 0); | 87 | MIAttachProcessJob(MIDebuggerPlugin *plugin, int pid, QObject *parent = nullptr); | ||
88 | | ||||
68 | void start() override; | 89 | void start() override; | ||
90 | | ||||
69 | protected: | 91 | protected: | ||
70 | bool doKill() override; | 92 | bool doKill() override; | ||
93 | | ||||
94 | private Q_SLOTS: | ||||
95 | void done(); | ||||
96 | | ||||
71 | private: | 97 | private: | ||
72 | DebugSession* m_session; | 98 | int m_pid; | ||
73 | private slots: | 99 | MIDebugSession *m_session; | ||
74 | void sessionFinished(); | | |||
75 | }; | 100 | }; | ||
76 | 101 | | |||
77 | } // end of namespace GDB | | |||
78 | } // end of namespace KDevMI | 102 | } // end of namespace KDevMI | ||
79 | 103 | | |||
80 | #endif | 104 | #endif // MIDEBUGJOBS_H |