forked from qt-creator/qt-creator
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: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -995,10 +995,14 @@ void QmlEngine::updateItem(const QByteArray &iname)
|
||||
const WatchItem *item = watchHandler()->findItem(iname);
|
||||
QTC_ASSERT(item, return);
|
||||
|
||||
QString exp = QString::fromUtf8(item->exp);
|
||||
d->evaluate(exp, [this, iname, exp](const QVariantMap &response) {
|
||||
d->handleEvaluateExpression(response, iname, exp);
|
||||
});
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user