diff options
author | Marcus Tillmanns <[email protected]> | 2024-01-15 14:08:05 +0100 |
---|---|---|
committer | Marcus Tillmanns <[email protected]> | 2024-01-15 15:04:37 +0000 |
commit | 06658d981cf3e2ec666afe09176e409091fdca25 (patch) | |
tree | 9cefda880d5ea0b12722e2f1b00ccfb042b707eb | |
parent | 2be9a658ad86f959be1a0beef0d323becbcf209f (diff) |
Utils: Fix (Q)Process::interrupt
Since switching to a QProcess based implementation a different
code path is used to interrupt processes (QProcessImpl::sendControlSignal, instead of ProcessLauncherImpl::sendControlSignal).
The QProcess path still used outdated ProcessHelper::interruptProcess.
This patch removes the old path and replaces it with the correct
"ProcessHelper::interruptPid" for QProcess based processes.
This also fixes GdbEngine::interruptInferior2 which could not interrupt
processes during "Attach to running server"
Change-Id: I9e1917100acf89c07cab0d9c687e57bb555d9d83
Reviewed-by: Jarek Kobus <[email protected]>
Reviewed-by: hjk <[email protected]>
-rw-r--r-- | src/libs/utils/process.cpp | 2 | ||||
-rw-r--r-- | src/libs/utils/processutils.cpp | 7 | ||||
-rw-r--r-- | src/libs/utils/processutils.h | 1 |
3 files changed, 1 insertions, 9 deletions
diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 69ba2ce1920..2474c0b1ffd 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -486,7 +486,7 @@ private: m_process->kill(); break; case ControlSignal::Interrupt: - ProcessHelper::interruptProcess(m_process); + ProcessHelper::interruptPid(m_process->processId()); break; case ControlSignal::KickOff: QTC_CHECK(false); diff --git a/src/libs/utils/processutils.cpp b/src/libs/utils/processutils.cpp index 1c4f988fc51..3e037f393fa 100644 --- a/src/libs/utils/processutils.cpp +++ b/src/libs/utils/processutils.cpp @@ -180,11 +180,4 @@ void ProcessHelper::interruptPid(qint64 pid) #endif } -void ProcessHelper::interruptProcess(QProcess *process) -{ - ProcessHelper *helper = qobject_cast<ProcessHelper *>(process); - if (helper && helper->m_useCtrlCStub) - ProcessHelper::interruptPid(process->processId()); -} - } // namespace Utils diff --git a/src/libs/utils/processutils.h b/src/libs/utils/processutils.h index c2a864db1fb..3ddc967317c 100644 --- a/src/libs/utils/processutils.h +++ b/src/libs/utils/processutils.h @@ -45,7 +45,6 @@ public: void setUseCtrlCStub(bool enabled); // release only static void terminateProcess(QProcess *process); - static void interruptProcess(QProcess *process); static void interruptPid(qint64 pid); private: |