Process: Add information about main thread to logging

Add a note if a process is started on the main thread. That adds
essential information to "blocking without event loop".

Task-number: QTCREATORBUG-31068
Change-Id: Iaf3bab88b79391c4ddc17d18a81e6d8ab712d22d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2024-06-17 10:07:29 +02:00
parent d22a95bc54
commit 56f2b1f1e8

View File

@@ -2140,9 +2140,10 @@ void ProcessPrivate::setupDebugLog()
static std::atomic_int startCounter = 0; static std::atomic_int startCounter = 0;
const int currentNumber = startCounter.fetch_add(1); const int currentNumber = startCounter.fetch_add(1);
qCDebug(processLog).nospace().noquote() qCDebug(processLog).nospace().noquote()
<< "Process " << currentNumber << " starting (" << "Process " << currentNumber << " starting ("
<< qPrintable(blockingMessage(property(QTC_PROCESS_BLOCKING_TYPE))) << qPrintable(blockingMessage(property(QTC_PROCESS_BLOCKING_TYPE)))
<< "): " << m_setup.m_commandLine.toUserOutput(); << (isMainThread() ? ", main thread" : "")
<< "): " << m_setup.m_commandLine.toUserOutput();
setProperty(QTC_PROCESS_NUMBER, currentNumber); setProperty(QTC_PROCESS_NUMBER, currentNumber);
}); });