From 6112bbd990cbd2e451e57c13a84411a08105a60f Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Fri, 26 Jan 2024 13:16:58 +0100 Subject: [PATCH] SshProcessInterface: Fix sending control signals For QDB devices make sure to only use `appcontroller --stop` when the process was also started with the appcontroller. Otherwise fall back to the SshProcessInterface implementation. Change-Id: I482f7ac9783f57eb8d85bb2b536ff00d428a2c3f Reviewed-by: Jarek Kobus Reviewed-by: Christian Kandeler --- src/plugins/boot2qt/qdbdevice.cpp | 6 +++++- src/plugins/remotelinux/linuxprocessinterface.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index 914626a5df1..9cc4852831f 100644 --- a/src/plugins/boot2qt/qdbdevice.cpp +++ b/src/plugins/boot2qt/qdbdevice.cpp @@ -41,7 +41,11 @@ private: { QTC_ASSERT(controlSignal != ControlSignal::Interrupt, return); QTC_ASSERT(controlSignal != ControlSignal::KickOff, return); - runInShell({Constants::AppcontrollerFilepath, {"--stop"}}); + if (m_setup.m_commandLine.executable().path() == Constants::AppcontrollerFilepath) { + runInShell({Constants::AppcontrollerFilepath, {"--stop"}}); + return; + } + SshProcessInterface::handleSendControlSignal(controlSignal); } }; diff --git a/src/plugins/remotelinux/linuxprocessinterface.h b/src/plugins/remotelinux/linuxprocessinterface.h index 2ef3d5df3aa..d158482f2fd 100644 --- a/src/plugins/remotelinux/linuxprocessinterface.h +++ b/src/plugins/remotelinux/linuxprocessinterface.h @@ -25,9 +25,9 @@ protected: qint64 processId() const; bool runInShell(const Utils::CommandLine &command, const QByteArray &data = {}); -private: virtual void handleSendControlSignal(Utils::ControlSignal controlSignal); +private: void start() final; qint64 write(const QByteArray &data) final; void sendControlSignal(Utils::ControlSignal controlSignal) final;