Debugger: Ensure breakpoints to simple JS expressions are hit

Prevent QDeclarativeEngine to handle simple bindings on their own by
setting the QML_DISABLE_OPTIMIZER environment variable. This ensures
that every binding is actually updated through the JavaScript engine,
and therefore checked for breakpoints.

Task-number: QTCREATORBUG-3595
This commit is contained in:
Kai Koehne
2011-02-07 10:55:22 +01:00
parent 028776ce08
commit 50b6a98bd6

View File

@@ -597,6 +597,12 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
sp.projectBuildDir = runConfiguration->target()
->activeBuildConfiguration()->buildDirectory();
// Makes sure that all bindings go through the JavaScript engine, so that
// breakpoints are actually hit!
if (!sp.environment.hasKey(QLatin1String("QML_DISABLE_OPTIMIZER"))) {
sp.environment.set(QLatin1String("QML_DISABLE_OPTIMIZER"), QLatin1String("1"));
}
Utils::QtcProcess::addArg(&sp.processArgs, QLatin1String("-qmljsdebugger=port:")
+ QString::number(sp.qmlServerPort));
}