From 41cefa6a2b7dbd1af33165b275bdd02d8a44332b Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 17 Aug 2022 14:40:26 +0200 Subject: [PATCH 1/3] LinuxDevice: Fix kill command on remote host Kill all the processes in the process group. For more info see: https://man7.org/linux/man-pages/man1/kill.1.html https://www.baeldung.com/linux/kill-members-process-group Fixes: QTCREATORBUG-28072 Change-Id: Id574774d16bc7d3386c6c5f80fb1d305065ec3dc Reviewed-by: Reviewed-by: Eike Ziller Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/linuxdevice.cpp | 4 ++-- src/plugins/remotelinux/remotelinuxsignaloperation.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 0ec48a41fe9..e11d6cd7db7 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -512,9 +512,9 @@ void LinuxProcessInterface::sendControlSignal(ControlSignal controlSignal) QTC_ASSERT(controlSignal != ControlSignal::KickOff, return); const qint64 pid = processId(); QTC_ASSERT(pid, return); // TODO: try sending a signal based on process name - const QString args = QString::fromLatin1("-%1 %2") + const QString args = QString::fromLatin1("-%1 -%2") .arg(controlSignalToInt(controlSignal)).arg(pid); - CommandLine command = { "kill", args, CommandLine::Raw }; + const CommandLine command = { "kill", args, CommandLine::Raw }; // Note: This blocking call takes up to 2 ms for local remote. runInShell(command); } diff --git a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp index a0dec6b269c..fbfdc7f1b40 100644 --- a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp +++ b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp @@ -43,7 +43,7 @@ RemoteLinuxSignalOperation::~RemoteLinuxSignalOperation() = default; static QString signalProcessGroupByPidCommandLine(qint64 pid, int signal) { - return QString::fromLatin1("kill -%1 %2").arg(signal).arg(pid); + return QString::fromLatin1("kill -%1 -%2").arg(signal).arg(pid); } void RemoteLinuxSignalOperation::run(const QString &command) From f866b03b191299e5d5cde11cdad905a90b94bf26 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 10 Aug 2022 19:55:58 +0200 Subject: [PATCH 2/3] CMakePM: Do not use displayName for build directory This code path was used when adding a new build type from settings via Add -> RelWithDebInfo and it would be expanded to "Release-with-Debug- Information". On Windows this can lead to long paths and problems. Change-Id: Ie6ab74414778a2e723bfa08d6765292dfe6bce22 Reviewed-by: Eike Ziller --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index a052fdc8b3b..038ec7302c5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1304,7 +1304,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) if (info.buildDirectory.isEmpty()) { setBuildDirectory(shadowBuildDirectory(target->project()->projectFilePath(), k, - info.displayName, + info.typeName, info.buildType)); } From e4bc08fb21c29e2f1b226ca4d73e019681f7bfc6 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 1 Sep 2022 08:07:47 +0200 Subject: [PATCH 3/3] RemoteLinux: Fix KillAppStep Was taking .toString() instead of .path() of the executable FilePath. Fixes: QTCREATORBUG-28124 Change-Id: I6286585393593cf97cbb2aeb5dbdd7c48bc95dbc Reviewed-by: Christian Stenger Reviewed-by: --- src/plugins/remotelinux/killappstep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/remotelinux/killappstep.cpp b/src/plugins/remotelinux/killappstep.cpp index 03d40e31666..a51c4c89b2a 100644 --- a/src/plugins/remotelinux/killappstep.cpp +++ b/src/plugins/remotelinux/killappstep.cpp @@ -133,7 +133,7 @@ KillAppStep::KillAppStep(BuildStepList *bsl, Id id) Target * const theTarget = target(); QTC_ASSERT(theTarget, return CheckResult::failure()); RunConfiguration * const rc = theTarget->activeRunConfiguration(); - const QString remoteExe = rc ? rc->runnable().command.executable().toString() : QString(); + const QString remoteExe = rc ? rc->runnable().command.executable().path() : QString(); service->setRemoteExecutable(remoteExe); return CheckResult::success(); });