forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.0'
Conflicts: src/plugins/debugger/debuggerruncontrol.cpp src/plugins/projectexplorer/projectwizardpage.cpp src/plugins/projectexplorer/xcodebuildparser.h src/plugins/qmldesigner/qmldesignerplugin.cpp src/tools/clangbackend/ipcsource/translationunits.cpp Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
This commit is contained in:
@@ -917,7 +917,7 @@ QString AndroidConfig::getAvdName(const QString &serialnumber)
|
||||
if (!ok)
|
||||
return QString();
|
||||
|
||||
QByteArray avdName = "avd name\n";
|
||||
const QByteArray avdName = "avd name\n";
|
||||
|
||||
QTcpSocket tcpSocket;
|
||||
tcpSocket.connectToHost(QHostAddress(QHostAddress::LocalHost), port);
|
||||
@@ -925,16 +925,15 @@ QString AndroidConfig::getAvdName(const QString &serialnumber)
|
||||
tcpSocket.write(avdName + "exit\n");
|
||||
tcpSocket.waitForDisconnected();
|
||||
|
||||
QByteArray response = tcpSocket.readAll();
|
||||
int start = response.indexOf("OK\r\n");
|
||||
if (start == -1)
|
||||
return QString();
|
||||
start = start + 4;
|
||||
|
||||
int end = response.indexOf("\r\n", start);
|
||||
if (end == -1)
|
||||
return QString();
|
||||
return QString::fromLatin1(response.mid(start, end - start));
|
||||
QByteArray name;
|
||||
const QByteArrayList response = tcpSocket.readAll().split('\n');
|
||||
// The input "avd name" might not be echoed as-is, but contain ASCII
|
||||
// control sequences.
|
||||
for (int i = response.size() - 1; i > 1; --i) {
|
||||
if (response.at(i).startsWith("OK"))
|
||||
name = response.at(i - 1);
|
||||
}
|
||||
return QString::fromLatin1(name).trimmed();
|
||||
}
|
||||
|
||||
AndroidConfig::OpenGl AndroidConfig::getOpenGLEnabled(const QString &emulator) const
|
||||
@@ -1288,6 +1287,7 @@ void AndroidConfigurations::updateAutomaticKitList()
|
||||
debugger.setUnexpandedDisplayName(tr("Android Debugger for %1").arg(tc->displayName()));
|
||||
debugger.setAutoDetected(true);
|
||||
debugger.setAbi(tc->targetAbi());
|
||||
debugger.reinitializeFromFile();
|
||||
QVariant id = Debugger::DebuggerItemManager::registerDebugger(debugger);
|
||||
Debugger::DebuggerKitInformation::setDebugger(k, id);
|
||||
}
|
||||
@@ -1334,6 +1334,7 @@ void AndroidConfigurations::updateAutomaticKitList()
|
||||
debugger.setUnexpandedDisplayName(tr("Android Debugger for %1").arg(tc->displayName()));
|
||||
debugger.setAutoDetected(true);
|
||||
debugger.setAbi(tc->targetAbi());
|
||||
debugger.reinitializeFromFile();
|
||||
QVariant id = Debugger::DebuggerItemManager::registerDebugger(debugger);
|
||||
Debugger::DebuggerKitInformation::setDebugger(newKit, id);
|
||||
|
||||
|
||||
@@ -92,11 +92,12 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
||||
params.startMode = AttachToRemoteServer;
|
||||
params.displayName = AndroidManager::packageName(target);
|
||||
params.remoteSetupNeeded = true;
|
||||
params.useContinueInsteadOfRun = true;
|
||||
|
||||
auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
|
||||
if (aspect->useCppDebugger()) {
|
||||
Kit *kit = target->kit();
|
||||
params.inferior.executable = target->activeBuildConfiguration()->buildDirectory().toString()
|
||||
params.symbolFile = target->activeBuildConfiguration()->buildDirectory().toString()
|
||||
+ QLatin1String("/app_process");
|
||||
params.skipExecutableValidation = true;
|
||||
params.remoteChannel = runConfig->remoteChannel();
|
||||
|
||||
@@ -354,7 +354,7 @@ AndroidDeployQtStep::DeployResult AndroidDeployQtStep::runDeploy(QFutureInterfac
|
||||
.arg(QDir::toNativeSeparators(m_command), args),
|
||||
BuildStep::MessageOutput);
|
||||
|
||||
while (!m_process->waitForFinished(200)) {
|
||||
while (m_process->state() != QProcess::NotRunning && !m_process->waitForFinished(200)) {
|
||||
if (fi.isCanceled()) {
|
||||
m_process->kill();
|
||||
m_process->waitForFinished();
|
||||
|
||||
@@ -249,13 +249,19 @@ static int extractPid(const QString &exeName, const QByteArray &psOutput)
|
||||
|
||||
QByteArray AndroidRunner::runPs()
|
||||
{
|
||||
QByteArray psLine("ps");
|
||||
if (m_isBusyBox)
|
||||
psLine += " -w";
|
||||
psLine += '\n';
|
||||
m_psProc.write(psLine);
|
||||
m_psProc.waitForBytesWritten(psLine.size());
|
||||
return m_psProc.readAllStandardOutput();
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QByteArray ret;
|
||||
QMetaObject::invokeMethod(this, "runPs", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QByteArray, ret));
|
||||
return ret;
|
||||
} else {
|
||||
QByteArray psLine("ps");
|
||||
if (m_isBusyBox)
|
||||
psLine += " -w";
|
||||
psLine += '\n';
|
||||
m_psProc.write(psLine);
|
||||
m_psProc.waitForBytesWritten(psLine.size());
|
||||
return m_psProc.readAllStandardOutput();
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidRunner::checkPID()
|
||||
|
||||
@@ -79,12 +79,12 @@ private slots:
|
||||
void logcatReadStandardError();
|
||||
void logcatReadStandardOutput();
|
||||
void asyncStart();
|
||||
QByteArray runPs();
|
||||
|
||||
private:
|
||||
void adbKill(qint64 pid);
|
||||
QStringList selector() const { return m_selector; }
|
||||
void forceStop();
|
||||
QByteArray runPs();
|
||||
void findPs();
|
||||
void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError);
|
||||
bool adbShellAmNeedsQuotes();
|
||||
|
||||
Reference in New Issue
Block a user