From 633e72f846c8bf61bfa136d46d13f004c1f6553d Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 12 Feb 2025 20:39:19 +0100 Subject: [PATCH] Android: Use lldb-server from the host lldb debugger path We want to have the lldb-server, matching the target ABI, from the NDK path from where we have the host lldb debugger. The previous version would take into consideration the default NDK if set, or the NDK version used to build Qt. Fixes: QTCREATORBUG-32494 Change-Id: Ibd1b4898052641a58a145d85181ae366800b3616 Reviewed-by: Alessandro Portale Reviewed-by: Assam Boudjelthia --- src/plugins/android/androidrunnerworker.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index b24b4814572..92b0f8f858b 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -8,6 +8,7 @@ #include "androidtr.h" #include "androidutils.h" +#include #include #include @@ -41,6 +42,7 @@ static Q_LOGGING_CATEGORY(androidRunWorkerLog, "qtc.android.run.androidrunnerwor static const int GdbTempFileMaxCounter = 20; } +using namespace Debugger; using namespace ProjectExplorer; using namespace Tasking; using namespace Utils; @@ -102,7 +104,11 @@ static FilePath debugServer(bool useLldb, const Target *target) if (useLldb) { // Search suitable lldb-server binary. - const FilePath prebuilt = AndroidConfig::ndkLocation(qtVersion) / "toolchains/llvm/prebuilt"; + const DebuggerItem *debugger = DebuggerKitAspect::debugger(target->kit()); + if (!debugger || debugger->command().isEmpty()) + return {}; + // .../ndk//toolchains/llvm/prebuilt//bin/lldb + const FilePath prebuilt = debugger->command().parentDir().parentDir(); const QString abiNeedle = lldbServerArch2(preferredAbi); // The new, built-in LLDB.