ProcessStub: Add missing if

When not starting in debug mode, the inferior is not waiting
for ptrace(DETACH), so the code that calls DETACH waits for
something that does not happen.

Fixes: QTCREATORBUG-29503
Change-Id: Ic00a52b9e4f3a797d1be337a2ce53afc6ee63927
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-08-15 15:27:15 +02:00
parent 324e924178
commit 02e2a642dc

View File

@@ -222,6 +222,7 @@ void onInferiorStarted()
if (!debugMode) if (!debugMode)
sendPid(inferiorId); sendPid(inferiorId);
#else #else
if (debugMode) {
qCInfo(log) << "Detaching ..."; qCInfo(log) << "Detaching ...";
ptrace(PTRACE_DETACH, inferiorId, 0, SIGSTOP); ptrace(PTRACE_DETACH, inferiorId, 0, SIGSTOP);
@@ -238,6 +239,7 @@ void onInferiorStarted()
else if (WIFCONTINUED(status)) else if (WIFCONTINUED(status))
qCInfo(log) << "inferior continued"; qCInfo(log) << "inferior continued";
} }
}
sendPid(inferiorId); sendPid(inferiorId);
#endif #endif