Commit 38d2baa2 authored by hjk's avatar hjk

Debugger: Ask JS debug server to evaluate(something) only when stopped

The server on the Qt side Q_ASSERTs otherwise, killing the application.

Change-Id: I273f12c4bc89bd3488fa6409fdbebc6a6ac2b606
Reviewed-by: default avatarChristian Stenger <>
Reviewed-by: default avatarhjk <>
parent 56993249
......@@ -995,10 +995,14 @@ void QmlEngine::updateItem(const QByteArray &iname)
const WatchItem *item = watchHandler()->findItem(iname);
QTC_ASSERT(item, return);
if (state() == InferiorStopOk) {
// The Qt side Q_ASSERTs otherwise. So postpone the evaluation,
// it will be triggered from from upateLocals() later.
QString exp = QString::fromUtf8(item->exp);
d->evaluate(exp, [this, iname, exp](const QVariantMap &response) {
d->handleEvaluateExpression(response, iname, exp);
void QmlEngine::selectWatchData(const QByteArray &iname)
......@@ -1348,6 +1352,10 @@ void QmlEnginePrivate::evaluate(const QString expr, const QmlCallback &cb)
// }
// }
// The Qt side Q_ASSERTs otherwise. So ignore the request and hope
// it will be repeated soon enough (which it will, e.g. in updateLocals)
QTC_ASSERT(engine->state() == InferiorStopOk, return);
DebuggerCommand cmd(EVALUATE);
cmd.arg(EXPRESSION, expr);
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