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 <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Dominik Holland
2024-01-26 13:16:58 +01:00
parent 4b7b04cb73
commit 6112bbd990
2 changed files with 6 additions and 2 deletions

View File

@@ -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);
}
};

View File

@@ -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;