forked from qt-creator/qt-creator
debugger: improve robustness of watchers
This solves one common case of adding the 'class' *(class X*)0xdeadbeef "needed" by gdb in case a local variable at the same location is known. Change-Id: I5b25530b00e512c6e9155fb111ff4dc916832074 Reviewed-on: http://codereview.qt.nokia.com/76 Reviewed-by: hjk
This commit is contained in:
@@ -595,16 +595,16 @@ static inline QString expression(const WatchItem *item)
|
||||
{
|
||||
if (!item->exp.isEmpty())
|
||||
return QString::fromAscii(item->exp);
|
||||
if (item->address && !item->type.isEmpty()) {
|
||||
return QString::fromAscii("*(%1*)%2").
|
||||
arg(QLatin1String(item->type), QLatin1String(item->hexAddress()));
|
||||
}
|
||||
if (const WatchItem *parent = item->parent) {
|
||||
if (!parent->exp.isEmpty())
|
||||
return QString::fromAscii("(%1).%2")
|
||||
.arg(QString::fromLatin1(parent->exp), item->name);
|
||||
}
|
||||
return QString();
|
||||
if (item->address && !item->type.isEmpty()) {
|
||||
return QString::fromAscii("*(%1*)%2").
|
||||
arg(QLatin1String(item->type), QLatin1String(item->hexAddress()));
|
||||
}
|
||||
if (const WatchItem *parent = item->parent) {
|
||||
if (!parent->exp.isEmpty())
|
||||
return QString::fromAscii("(%1).%2")
|
||||
.arg(QString::fromLatin1(parent->exp), item->name);
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
QVariant WatchModel::data(const QModelIndex &idx, int role) const
|
||||
|
||||
Reference in New Issue
Block a user