Debugger: Add a message when trying to evaluate a bad expression

Change-Id: Id10f11876e9b6c852a04add6bd75aec7e8337891
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-02-21 11:20:12 +01:00
parent 58282bdab3
commit a4c0712cb2

View File

@@ -920,8 +920,12 @@ public:
else
exp = fixCppExpression(exp);
exp = exp.trimmed();
if (exp.isEmpty())
if (exp.isEmpty()) {
// Happens e.g. when trying to evaluate 'char' or 'return'.
AsynchronousMessageBox::warning(tr("Warning"),
tr("Select a valid expression to evaluate."));
return;
}
currentEngine()->watchHandler()->watchVariable(exp);
}