2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
2014-10-01 13:21:18 +02:00
|
|
|
** conditions see http://www.qt.io/licensing. For further information
|
|
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2011-01-10 10:35:41 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-01-10 10:35:41 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-01-10 10:35:41 +01:00
|
|
|
|
2014-10-17 13:40:04 +02:00
|
|
|
#ifndef DEBUGGERRUNCONTROL_H
|
|
|
|
|
#define DEBUGGERRUNCONTROL_H
|
2011-01-10 10:35:41 +01:00
|
|
|
|
2014-10-17 13:40:04 +02:00
|
|
|
#include "debugger_global.h"
|
2014-10-17 13:06:37 +02:00
|
|
|
#include "debuggerconstants.h"
|
|
|
|
|
|
2011-01-10 10:35:41 +01:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
|
2014-10-20 14:03:47 +02:00
|
|
|
namespace ProjectExplorer { class Kit; }
|
|
|
|
|
|
2011-01-10 10:35:41 +01:00
|
|
|
namespace Debugger {
|
2012-08-15 13:21:37 +02:00
|
|
|
|
2011-02-24 16:50:15 +01:00
|
|
|
class DebuggerEngine;
|
2012-08-15 13:21:37 +02:00
|
|
|
class DebuggerStartParameters;
|
|
|
|
|
|
2014-10-17 13:40:04 +02:00
|
|
|
class DEBUGGER_EXPORT DebuggerRunControl
|
|
|
|
|
: public ProjectExplorer::RunControl
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
~DebuggerRunControl();
|
|
|
|
|
|
|
|
|
|
// ProjectExplorer::RunControl
|
|
|
|
|
void start();
|
|
|
|
|
bool promptToStop(bool *prompt = 0) const;
|
|
|
|
|
StopResult stop(); // Called from SnapshotWindow.
|
|
|
|
|
bool isRunning() const;
|
|
|
|
|
QString displayName() const;
|
|
|
|
|
|
|
|
|
|
void startFailed();
|
|
|
|
|
void debuggingFinished();
|
|
|
|
|
DebuggerEngine *engine();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void engineRequestSetup();
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void handleFinished();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend class DebuggerRunControlFactory;
|
|
|
|
|
DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfiguration, DebuggerEngine *engine);
|
|
|
|
|
|
|
|
|
|
DebuggerEngine *m_engine;
|
|
|
|
|
bool m_running;
|
|
|
|
|
};
|
2011-01-10 10:35:41 +01:00
|
|
|
|
2014-10-17 13:40:04 +02:00
|
|
|
class DEBUGGER_EXPORT DebuggerRunControlFactory
|
2011-01-10 10:35:41 +01:00
|
|
|
: public ProjectExplorer::IRunControlFactory
|
|
|
|
|
{
|
|
|
|
|
public:
|
2012-06-27 22:19:20 +02:00
|
|
|
explicit DebuggerRunControlFactory(QObject *parent);
|
2011-01-10 10:35:41 +01:00
|
|
|
|
|
|
|
|
// FIXME: Used by qmljsinspector.cpp:469
|
2012-08-15 13:21:37 +02:00
|
|
|
ProjectExplorer::RunControl *create(
|
|
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration,
|
2012-09-05 12:42:41 +02:00
|
|
|
ProjectExplorer::RunMode mode,
|
|
|
|
|
QString *errorMessage);
|
2012-08-15 13:21:37 +02:00
|
|
|
|
|
|
|
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
|
|
|
|
ProjectExplorer::RunMode mode) const;
|
2011-01-10 10:35:41 +01:00
|
|
|
|
2011-02-24 16:50:15 +01:00
|
|
|
static DebuggerEngine *createEngine(DebuggerEngineType et,
|
2012-08-15 13:21:37 +02:00
|
|
|
const DebuggerStartParameters &sp,
|
|
|
|
|
QString *errorMessage);
|
|
|
|
|
|
2014-10-20 14:03:47 +02:00
|
|
|
static bool fillParametersFromKit(DebuggerStartParameters *sp,
|
|
|
|
|
const ProjectExplorer::Kit *kit, QString *errorMessage = 0);
|
|
|
|
|
|
|
|
|
|
static bool fillParametersFromLocalRunConfiguration(DebuggerStartParameters *sp,
|
|
|
|
|
const ProjectExplorer::RunConfiguration *rc, QString *errorMessage = 0);
|
|
|
|
|
|
2014-07-29 17:57:04 +02:00
|
|
|
static DebuggerRunControl *createAndScheduleRun(const DebuggerStartParameters &sp);
|
2012-08-15 13:21:37 +02:00
|
|
|
|
|
|
|
|
static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp,
|
2012-09-05 12:42:41 +02:00
|
|
|
ProjectExplorer::RunConfiguration *rc, QString *errorMessage);
|
2011-02-24 16:50:15 +01:00
|
|
|
|
2013-03-26 17:03:57 +01:00
|
|
|
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(
|
|
|
|
|
ProjectExplorer::RunConfiguration *rc);
|
2011-01-10 10:35:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
2014-10-17 13:40:04 +02:00
|
|
|
#endif // DEBUGGERRUNCONTROL_H
|