aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/android/androiddebugsupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/android/androiddebugsupport.cpp')
-rw-r--r--src/plugins/android/androiddebugsupport.cpp42
1 files changed, 27 insertions, 15 deletions
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp
index 3ffed5e7ec..04ec22f66c 100644
--- a/src/plugins/android/androiddebugsupport.cpp
+++ b/src/plugins/android/androiddebugsupport.cpp
@@ -55,6 +55,7 @@ static Q_LOGGING_CATEGORY(androidDebugSupportLog, "qtc.android.run.androiddebugs
using namespace Debugger;
using namespace ProjectExplorer;
+using namespace Utils;
namespace Android {
namespace Internal {
@@ -105,6 +106,7 @@ AndroidDebugSupport::AndroidDebugSupport(RunControl *runControl, const QString &
: Debugger::DebuggerRunTool(runControl)
{
setId("AndroidDebugger");
+ setLldbPlatform("remote-android");
m_runner = new AndroidRunner(runControl, intentName);
addStartDependency(m_runner);
}
@@ -120,11 +122,11 @@ void AndroidDebugSupport::start()
setUseContinueInsteadOfRun(true);
setAttachPid(m_runner->pid());
- qCDebug(androidDebugSupportLog) << "Start. Package name: " << packageName
- << "PID: " << m_runner->pid().pid();
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(kit);
- if (!Utils::HostOsInfo::isWindowsHost() &&
- AndroidConfigurations::currentConfig().ndkVersion(qtVersion) >= QVersionNumber(11, 0, 0)) {
+ if (!Utils::HostOsInfo::isWindowsHost()
+ && (qtVersion
+ && AndroidConfigurations::currentConfig().ndkVersion(qtVersion)
+ >= QVersionNumber(11, 0, 0))) {
qCDebug(androidDebugSupportLog) << "UseTargetAsync: " << true;
setUseTargetAsync(true);
}
@@ -146,25 +148,33 @@ void AndroidDebugSupport::start()
setUseExtendedRemote(true);
QString devicePreferredAbi = AndroidManager::apkDevicePreferredAbi(target);
setAbi(AndroidManager::androidAbi2Abi(devicePreferredAbi));
- QUrl gdbServer;
- gdbServer.setHost(QHostAddress(QHostAddress::LocalHost).toString());
- gdbServer.setPort(m_runner->gdbServerPort().number());
- setRemoteChannel(gdbServer);
+
+ QUrl debugServer;
+ debugServer.setPort(m_runner->debugServerPort().number());
+ if (cppEngineType() == LldbEngineType) {
+ debugServer.setScheme("adb");
+ debugServer.setHost(AndroidManager::deviceSerialNumber(target));
+ setRemoteChannel(debugServer.toString());
+ } else {
+ debugServer.setHost(QHostAddress(QHostAddress::LocalHost).toString());
+ setRemoteChannel(debugServer);
+ }
auto qt = static_cast<AndroidQtVersion *>(qtVersion);
- QTC_CHECK(qt);
const int minimumNdk = qt ? qt->minimumNDK() : 0;
int sdkVersion = qMax(AndroidManager::minimumSDK(kit), minimumNdk);
// TODO find a way to use the new sysroot layout
// instead ~/android/ndk-bundle/platforms/android-29/arch-arm64
// use ~/android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot
- Utils::FilePath sysRoot = AndroidConfigurations::currentConfig().ndkLocation(qtVersion)
- .pathAppended("platforms")
- .pathAppended(QString("android-%1").arg(sdkVersion))
- .pathAppended(devicePreferredAbi);
- setSysRoot(sysRoot);
- qCDebug(androidDebugSupportLog) << "Sysroot: " << sysRoot;
+ if (qtVersion) {
+ Utils::FilePath sysRoot = AndroidConfigurations::currentConfig().ndkLocation(qtVersion)
+ / "platforms"
+ / QString("android-%1").arg(sdkVersion)
+ / devicePreferredAbi;
+ setSysRoot(sysRoot);
+ qCDebug(androidDebugSupportLog) << "Sysroot: " << sysRoot;
+ }
}
if (isQmlDebugging()) {
qCDebug(androidDebugSupportLog) << "QML debugging enabled. QML server: "
@@ -175,6 +185,8 @@ void AndroidDebugSupport::start()
addSearchDirectory(qtVersion->qmlPath());
}
+ qCDebug(androidDebugSupportLog) << "Starting debugger - package name: " << packageName
+ << ", PID: " << m_runner->pid().pid();
DebuggerRunTool::start();
}