forked from qt-creator/qt-creator
Debugger: split fixCppExpression into some common and some cdb part
Task-number: QTCREATORBUG-8446 Change-Id: I79abc7f75779db15bd8700c085b9cd57411bb2e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
@@ -820,7 +820,7 @@ QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
|
||||
// free debugger expression.
|
||||
QString fixCppExpression(const QString &expIn)
|
||||
{
|
||||
QString exp = expIn;
|
||||
QString exp = expIn.trimmed();;
|
||||
// Extract the first identifier, everything else is considered
|
||||
// too dangerous.
|
||||
int pos1 = 0, pos2 = exp.size();
|
||||
@@ -838,7 +838,12 @@ QString fixCppExpression(const QString &expIn)
|
||||
}
|
||||
}
|
||||
exp = exp.mid(pos1, pos2 - pos1);
|
||||
return removeObviousSideEffects(exp);
|
||||
}
|
||||
|
||||
QString removeObviousSideEffects(const QString &expIn)
|
||||
{
|
||||
QString exp = expIn.trimmed();
|
||||
if (exp.isEmpty() || exp.startsWith(QLatin1Char('#')) || !hasLetterOrNumber(exp) || isKeyWord(exp))
|
||||
return QString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user