Commit d954c944 authored by Joerg Bornemann's avatar Joerg Bornemann

Fix application output of qtestlib projects when debugging with CDB

Tell QTestLib to use OutputDebugString for logging when "Run in
Terminal" is turned off. This way we are able to distinguish CDB's
output from the debuggee's output.

Task-number: QTCREATORBUG-16161
Change-Id: Ie5e6e4a0cbb853167766f782521101eff2e1963a
Reviewed-by: default avatarhjk <hjk@qt.io>
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 2605108f
......@@ -607,10 +607,17 @@ bool CdbEngine::launchCDB(const DebuggerRunParameters &sp, QString *errorMessage
m_outputBuffer.clear();
m_autoBreakPointCorrection = false;
const QStringList inferiorEnvironment = sp.inferior.environment.size() == 0 ?
QProcessEnvironment::systemEnvironment().toStringList() :
sp.inferior.environment.toStringList();
m_process.setEnvironment(mergeEnvironment(inferiorEnvironment, extensionFi.absolutePath()));
Utils::Environment inferiorEnvironment = sp.inferior.environment.size() == 0
? Utils::Environment::systemEnvironment() : sp.inferior.environment;
// Make sure that QTestLib uses OutputDebugString for logging.
const QString qtLoggingToConsoleKey = QStringLiteral("QT_LOGGING_TO_CONSOLE");
if (!sp.useTerminal && !inferiorEnvironment.hasKey(qtLoggingToConsoleKey))
inferiorEnvironment.set(qtLoggingToConsoleKey, QString(QLatin1Char('0')));
m_process.setEnvironment(mergeEnvironment(inferiorEnvironment.toStringList(),
extensionFi.absolutePath()));
if (!sp.inferior.workingDirectory.isEmpty())
m_process.setWorkingDirectory(sp.inferior.workingDirectory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment