diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index b4cfd13f26e6acdb9fa1fc4eb606508c17283e1d..a4adf74e5064a5c8f3acf8d0299bdfb95fc56115 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -602,8 +602,21 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const break; } - case ExpressionRole: - return data.exp; + case ExpressionRole: { + if (!data.exp.isEmpty()) + return data.exp; + if (!data.addr.isEmpty() && !data.type.isEmpty()) { + bool ok; + const quint64 addr = data.addr.toULongLong(&ok, 16); + if (ok && addr) + return QString("*(%1*)%2").arg(data.type).arg(addr); + } + WatchItem *parent = item->parent; + if (parent && !parent->exp.isEmpty()) + return QString("(%1).%2") + .arg(QString::fromLatin1(parent->exp)).arg(data.name); + return QVariant(); + } case INameRole: return data.iname;