From ea77f3f02d6ef396c5176f77e3e9bad9b5b89eac Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 16 Sep 2024 16:30:29 +0200 Subject: [PATCH] LldbEngine: Don't blocking wait for ready read It doesn't seem that the blocking wait for ready read is needed, as in case of Android plugin it always times out without anything being read. The wait was introduced in 59640aa7aaf1220a2739de021203f14834fc12b9. Delay the notification about successful start of debuged android process until the tempDebugServerPath is found. Change-Id: Id1f3e9df195d864f3fbf1ff57cb0f704d09657ef Reviewed-by: Christian Stenger Reviewed-by: Alessandro Portale --- src/plugins/android/androidrunnerworker.cpp | 14 ++++++++++---- src/plugins/debugger/lldb/lldbengine.cpp | 3 --- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 656d01839d6..4aad98a8a3c 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -642,10 +642,14 @@ static ExecutableItem uploadDebugServerRecipe(RunnerStorage *storage, const QStr *tempDebugServerPathStorage = tempDebugServerPath(iterator.iteration()); return true; }; - const auto onTempDebugServerPath = [tempDebugServerPathStorage] { + const auto onTempDebugServerPath = [storage, tempDebugServerPathStorage] { const bool tempDirOK = !tempDebugServerPathStorage->isEmpty(); - if (!tempDirOK) + if (tempDirOK) { + emit storage->remoteProcessStarted(s_localDebugServerPort, storage->m_qmlServer, + storage->m_processPID); + } else { qCDebug(androidRunWorkerLog) << "Can not get temporary file name"; + } return tempDirOK; }; @@ -843,8 +847,10 @@ static ExecutableItem pidRecipe(RunnerStorage *storage) if (ok) { storage->m_processUser = processUser; qCDebug(androidRunWorkerLog) << "Process ID changed to:" << storage->m_processPID; - emit storage->remoteProcessStarted(s_localDebugServerPort, storage->m_qmlServer, - storage->m_processPID); + if (!storage->m_useCppDebugger) { + emit storage->remoteProcessStarted(s_localDebugServerPort, storage->m_qmlServer, + storage->m_processPID); + } return DoneResult::Success; } } diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 3fb47e92163..90778f26427 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -218,9 +218,6 @@ void LldbEngine::setupEngine() void LldbEngine::handleLldbStarted() { - using namespace std::chrono_literals; - m_lldbProc.waitForReadyRead(1s); - showStatusMessage(Tr::tr("Setting up inferior...")); const DebuggerRunParameters &rp = runParameters();