1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
/*
SPDX-FileCopyrightText: 2006 Vladimir Prus <ghost@cs.msu.su>
SPDX-FileCopyrightText: 2007 Hamish Rodda <rodda@kde.org>
SPDX-FileCopyrightText: 2009 Andreas Pakulat <apaku@gmx.de>
SPDX-FileCopyrightText: 2016 Aetf <aetf@unlimitedcodeworks.xyz>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef MIDEBUGJOBS_H
#define MIDEBUGJOBS_H
#include <outputview/outputjob.h>
#include <QPointer>
class IExecutePlugin;
namespace KDevelop
{
class OutputModel;
class ILaunchConfiguration;
}
namespace KDevMI {
class MIDebuggerPlugin;
class MIDebugSession;
template<class JobBase>
class MIDebugJobBase : public JobBase
{
public:
explicit MIDebugJobBase(MIDebuggerPlugin* plugin, QObject* parent);
~MIDebugJobBase() override;
protected:
void done();
bool doKill() override;
QPointer<MIDebugSession> m_session;
};
class MIDebugJob : public MIDebugJobBase<KDevelop::OutputJob>
{
Q_OBJECT
public:
enum {
// Add a "random" number to KJob::UserDefinedError and hopefully avoid clashes with OutputJob's error codes.
InvalidExecutable = UserDefinedError + 231,
ExecutableIsNotExecutable,
InvalidArguments
};
MIDebugJob(MIDebuggerPlugin* p, KDevelop::ILaunchConfiguration* launchcfg, IExecutePlugin* plugin,
QObject* parent = nullptr);
void start() override;
private Q_SLOTS:
void stdoutReceived(const QStringList&);
void stderrReceived(const QStringList&);
private:
void finishWithError(int errorCode, const QString& errorText);
KDevelop::OutputModel* model();
KDevelop::ILaunchConfiguration* m_launchcfg;
IExecutePlugin* m_execute;
};
class MIExamineCoreJob : public MIDebugJobBase<KJob>
{
Q_OBJECT
public:
explicit MIExamineCoreJob(MIDebuggerPlugin *plugin, QObject *parent = nullptr);
void start() override;
};
class MIAttachProcessJob : public MIDebugJobBase<KJob>
{
Q_OBJECT
public:
MIAttachProcessJob(MIDebuggerPlugin *plugin, int pid, QObject *parent = nullptr);
void start() override;
private:
int m_pid;
};
} // end of namespace KDevMI
#endif // MIDEBUGJOBS_H
|