Make sure we pull the right app_process from device.

On arm64 devices /system/bin/app_process is a symlink to /system/bin/
app_process64, the problem is that we are pulling it also for 32bit
apps, which will make the debugging impossible because arm-linux-
androideabi-gdb 32bit can't mix the architectures.

Change-Id: I37e071456fb89051b0433ee2e7635085257616ea
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
BogDan Vatra
2015-05-22 21:03:01 +03:00
parent 6d67f9429e
commit a88636bd51
2 changed files with 11 additions and 1 deletions

View File

@@ -48,6 +48,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/qtkitinformation.h>
@@ -201,6 +202,14 @@ bool AndroidDeployQtStep::init()
m_avdName = info.avdname;
m_serialNumber = info.serialNumber;
m_appProcess = QLatin1String("readlink -f -s /system/bin/app_process");
if (info.cpuAbi.contains(QLatin1String("arm64-v8a"))) {
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
if (tc && tc->targetAbi().wordWidth() == 64)
m_appProcess += QLatin1String("64");
else
m_appProcess += QLatin1String("32");
}
AndroidManager::setDeviceSerialNumber(target(), m_serialNumber);
@@ -464,7 +473,7 @@ QString AndroidDeployQtStep::systemAppProcessFilePath() const
QProcess proc;
const QStringList args =
QStringList() << AndroidDeviceInfo::adbSelector(m_serialNumber) << QLatin1String("shell")
<< QLatin1String("readlink -f -s /system/bin/app_process");
<< m_appProcess;
proc.start(m_adbPath, args);
proc.waitForFinished();
return QString::fromUtf8(proc.readAll()).trimmed();