2013-04-25 16:02:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
2016-01-15 14:57:40 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
#include "iosconfigurations.h"
|
2014-03-28 19:05:35 +01:00
|
|
|
#include "iostoolhandler.h"
|
2014-11-12 19:41:59 +01:00
|
|
|
#include "iossimulator.h"
|
2014-03-28 19:05:35 +01:00
|
|
|
|
2016-09-26 12:40:09 +02:00
|
|
|
#include <debugger/debuggerconstants.h>
|
2017-05-19 16:59:02 +02:00
|
|
|
#include <debugger/debuggerruncontrol.h>
|
2017-03-28 18:51:29 +02:00
|
|
|
|
2014-03-28 19:05:35 +01:00
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2017-03-28 18:51:29 +02:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
|
2015-08-10 17:43:58 +02:00
|
|
|
#include <qmldebug/qmldebugcommandlinearguments.h>
|
2017-05-19 16:59:02 +02:00
|
|
|
#include <qmldebug/qmloutputparser.h>
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
namespace Ios {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2017-05-19 16:59:02 +02:00
|
|
|
class IosRunner : public ProjectExplorer::RunWorker
|
2013-04-25 16:02:17 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2017-05-19 16:59:02 +02:00
|
|
|
IosRunner(ProjectExplorer::RunControl *runControl);
|
2013-04-25 16:02:17 +02:00
|
|
|
~IosRunner();
|
|
|
|
|
|
2017-05-19 16:59:02 +02:00
|
|
|
void setCppDebugging(bool cppDebug);
|
|
|
|
|
void setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugServices);
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
QString bundlePath();
|
|
|
|
|
QStringList extraArgs();
|
|
|
|
|
QString deviceId();
|
|
|
|
|
IosToolHandler::RunKind runType();
|
2014-02-25 22:48:19 +01:00
|
|
|
bool cppDebug() const;
|
2017-06-26 14:15:44 +02:00
|
|
|
bool qmlDebug() const;
|
2015-08-10 17:43:58 +02:00
|
|
|
QmlDebug::QmlDebugServicesPreset qmlDebugServices() const;
|
2016-06-29 19:35:23 +03:00
|
|
|
|
2017-05-19 16:59:02 +02:00
|
|
|
void start() override;
|
|
|
|
|
void stop() override;
|
|
|
|
|
|
|
|
|
|
virtual void appOutput(const QString &/*output*/) {}
|
|
|
|
|
virtual void errorMsg(const QString &/*msg*/) {}
|
2013-04-25 16:02:17 +02:00
|
|
|
|
2017-05-19 16:59:02 +02:00
|
|
|
Utils::Port qmlServerPort() const;
|
|
|
|
|
Utils::Port gdbServerPort() const;
|
|
|
|
|
qint64 pid() const;
|
|
|
|
|
bool isAppRunning() const;
|
2015-09-11 13:32:45 +02:00
|
|
|
|
|
|
|
|
private:
|
2014-02-25 22:48:19 +01:00
|
|
|
void handleGotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath,
|
2016-04-19 16:43:30 +02:00
|
|
|
const QString &deviceId, Utils::Port gdbPort, Utils::Port qmlPort);
|
2013-04-25 16:02:17 +02:00
|
|
|
void handleGotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
2015-09-11 13:13:04 +02:00
|
|
|
const QString &deviceId, qint64 pid);
|
2013-04-25 16:02:17 +02:00
|
|
|
void handleAppOutput(Ios::IosToolHandler *handler, const QString &output);
|
|
|
|
|
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
|
|
|
|
|
void handleToolExited(Ios::IosToolHandler *handler, int code);
|
|
|
|
|
void handleFinished(Ios::IosToolHandler *handler);
|
2015-09-11 13:32:45 +02:00
|
|
|
|
2017-03-28 18:51:29 +02:00
|
|
|
IosToolHandler *m_toolHandler = nullptr;
|
2013-04-25 16:02:17 +02:00
|
|
|
QString m_bundleDir;
|
|
|
|
|
QStringList m_arguments;
|
|
|
|
|
ProjectExplorer::IDevice::ConstPtr m_device;
|
2014-11-12 19:41:59 +01:00
|
|
|
IosDeviceType m_deviceType;
|
2017-05-19 16:59:02 +02:00
|
|
|
bool m_cppDebug = false;
|
|
|
|
|
QmlDebug::QmlDebugServicesPreset m_qmlDebugServices = QmlDebug::NoQmlDebugServices;
|
2015-08-10 17:43:58 +02:00
|
|
|
|
2017-03-28 18:51:29 +02:00
|
|
|
bool m_cleanExit = false;
|
2017-05-19 16:59:02 +02:00
|
|
|
Utils::Port m_qmlServerPort;
|
|
|
|
|
Utils::Port m_gdbServerPort;
|
2017-03-28 18:51:29 +02:00
|
|
|
qint64 m_pid = 0;
|
2013-04-25 16:02:17 +02:00
|
|
|
};
|
|
|
|
|
|
2017-05-19 16:59:02 +02:00
|
|
|
|
|
|
|
|
class IosRunSupport : public IosRunner
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit IosRunSupport(ProjectExplorer::RunControl *runControl);
|
|
|
|
|
~IosRunSupport() override;
|
|
|
|
|
|
|
|
|
|
void didStartApp(IosToolHandler::OpStatus status);
|
|
|
|
|
private:
|
|
|
|
|
void start() override;
|
|
|
|
|
void stop() override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class IosAnalyzeSupport : public IosRunner
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
IosAnalyzeSupport(ProjectExplorer::RunControl *runControl);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void start() override;
|
|
|
|
|
|
|
|
|
|
void qmlServerReady();
|
|
|
|
|
void appOutput(const QString &output) override;
|
|
|
|
|
void errorMsg(const QString &output) override;
|
|
|
|
|
|
|
|
|
|
QmlDebug::QmlOutputParser m_outputParser;
|
|
|
|
|
IosRunner *m_runner;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class IosDebugSupport : public Debugger::DebuggerRunTool
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
IosDebugSupport(ProjectExplorer::RunControl *runControl);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void start() override;
|
|
|
|
|
void onFinished() override;
|
|
|
|
|
|
|
|
|
|
const QString m_dumperLib;
|
|
|
|
|
IosRunner *m_runner;
|
|
|
|
|
};
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Ios
|