Merge remote-tracking branch 'origin/4.4'

Conflicts:
	src/plugins/debugger/gdb/gdbengine.cpp

Change-Id: I8a7c8ca07d6d6005f5d39b8f1477ebbc7a299fbf
This commit is contained in:
Eike Ziller
2017-08-17 17:29:25 +02:00
34 changed files with 198 additions and 69 deletions

View File

@@ -133,6 +133,7 @@ void AndroidDebugSupport::start()
.appendPath(toNdkArch(AndroidManager::targetArch(target))).toString();
}
if (isQmlDebugging()) {
params.qmlServer.host = m_runner->qmlServerHost();
params.qmlServer.port = m_runner->qmlServerPort();
//TODO: Not sure if these are the right paths.
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);

View File

@@ -241,7 +241,7 @@ void AndroidManager::setDeviceSerialNumber(ProjectExplorer::Target *target, cons
QPair<int, int> AndroidManager::apiLevelRange()
{
return qMakePair(9, 23);
return qMakePair(9, 26);
}
QString AndroidManager::androidNameForApiLevel(int x)
@@ -291,6 +291,8 @@ QString AndroidManager::androidNameForApiLevel(int x)
return QLatin1String("Android 7.0");
case 25:
return QLatin1String("Android 7.1");
case 26:
return QLatin1String("Android 8.0");
default:
return tr("Unknown Android version. API Level: %1").arg(QString::number(x));
}

View File

@@ -226,7 +226,8 @@ public:
Utils::Port localGdbServerPort() const { return m_localGdbServerPort; }
signals:
void remoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlServerPort, int pid);
void remoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlServerPort,
QString qmlServerHost, int pid);
void remoteProcessFinished(const QString &errString = QString());
void remoteOutput(const QString &output);
@@ -257,6 +258,7 @@ private:
bool m_useCppDebugger = false;
QmlDebug::QmlDebugServicesPreset m_qmlDebugServices;
Utils::Port m_localGdbServerPort; // Local end of forwarded debug socket.
QString m_qmlServerHost;
Utils::Port m_qmlPort;
QString m_pingFile;
QString m_pongFile;
@@ -295,6 +297,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunControl *runControl, const AndroidRu
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6),
qDebug() << tr("No free ports available on host for QML debugging."));
m_qmlServerHost = server.serverAddress().toString();
m_qmlPort = Utils::Port(server.serverPort());
} else {
m_qmlPort = Utils::Port();
@@ -638,7 +641,7 @@ void AndroidRunnerWorker::onProcessIdChanged(qint64 pid)
} else {
// In debugging cases this will be funneled to the engine to actually start
// and attach gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below.
emit remoteProcessStarted(m_localGdbServerPort, m_qmlPort, m_processPID);
emit remoteProcessStarted(m_localGdbServerPort, m_qmlPort, m_qmlServerHost, m_processPID);
logcatReadStandardOutput();
QTC_ASSERT(!m_psIsAlive, /**/);
m_psIsAlive.reset(new QProcess);
@@ -782,10 +785,12 @@ void AndroidRunner::remoteErrorOutput(const QString &output)
m_outputParser.processOutput(output);
}
void AndroidRunner::handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlServerPort, int pid)
void AndroidRunner::handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlServerPort,
QString qmlServerHost, int pid)
{
m_pid = ProcessHandle(pid);
m_gdbServerPort = gdbServerPort;
m_qmlServerHost = qmlServerHost;
m_qmlServerPort = qmlServerPort;
reportStarted();
}

View File

@@ -57,6 +57,7 @@ public:
const AndroidRunnable &runnable() const { return m_androidRunnable; }
Utils::Port gdbServerPort() const { return m_gdbServerPort; }
QString qmlServerHost() const { return m_qmlServerHost; }
Utils::Port qmlServerPort() const { return m_qmlServerPort; }
Utils::ProcessHandle pid() const { return m_pid; }
@@ -76,7 +77,8 @@ private:
void remoteOutput(const QString &output);
void remoteErrorOutput(const QString &output);
void gotRemoteOutput(const QString &output);
void handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlServerPort, int pid);
void handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlServerPort,
QString qmlServerHost, int pid);
void handleRemoteProcessFinished(const QString &errString = QString());
void checkAVD();
void launchAVD();
@@ -88,6 +90,7 @@ private:
QScopedPointer<AndroidRunnerWorker> m_worker;
QPointer<ProjectExplorer::Target> m_target;
Utils::Port m_gdbServerPort;
QString m_qmlServerHost;
Utils::Port m_qmlServerPort;
Utils::ProcessHandle m_pid;
QmlDebug::QmlOutputParser m_outputParser;

View File

@@ -203,7 +203,8 @@ bool AndroidToolChain::fromMap(const QVariantMap &data)
FileNameList AndroidToolChain::suggestedMkspecList() const
{
return FileNameList()<< FileName::fromLatin1("android-g++");
return FileNameList() << FileName::fromLatin1("android-g++")
<< FileName::fromLatin1("android-clang");
}
QString AndroidToolChain::makeCommand(const Environment &env) const