Commit d9135665 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Debugger: Fix removal of expression that ends with whitespace

* Start a debugging session
* Add an evaluated expression "(char*)foo "
* Delete the expression
* Press F10
* It reappears

Change-Id: I5c54ca6ab2f4be6c613880a2747e4aff653d15be
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 59172f9a
......@@ -919,6 +919,7 @@ public slots:
exp = removeObviousSideEffects(exp);
else
exp = fixCppExpression(exp);
exp = exp.trimmed();
if (exp.isEmpty())
return;
currentEngine()->watchHandler()->watchVariable(exp);
......
......@@ -856,7 +856,7 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role
case Qt::EditRole:
switch (idx.column()) {
case 0: {
m_handler->watchExpression(value.toString());
m_handler->watchExpression(value.toString().trimmed());
break;
}
case 1: // Change value
......@@ -1491,7 +1491,7 @@ void WatchHandler::loadSessionData()
QVariant value = sessionValue("Watchers");
m_model->m_watchRoot->removeChildren();
foreach (const QString &exp, value.toStringList())
watchExpression(exp);
watchExpression(exp.trimmed());
}
WatchModelBase *WatchHandler::model() const
......
......@@ -1108,7 +1108,7 @@ void WatchTreeView::inputNewExpression()
"\">documentation</a>."));
dlg.setHistoryCompleter(QLatin1String("WatchItems"));
if (dlg.exec() == QDialog::Accepted) {
QString exp = dlg.text();
const QString exp = dlg.text().trimmed();
if (!exp.isEmpty())
watchExpression(exp, exp);
}
......
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