summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/watchhandler.cpp20
-rw-r--r--src/plugins/debugger/watchutils.cpp10
2 files changed, 18 insertions, 12 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 4702b6394a..9cd7dbd5e4 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -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
diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp
index ed59a6979e..f8bcb1c64a 100644
--- a/src/plugins/debugger/watchutils.cpp
+++ b/src/plugins/debugger/watchutils.cpp
@@ -739,8 +739,14 @@ static void setWatchDataAddress(WatchData &data, quint64 address , quint64 origA
} else {
data.address = address;
}
- if (data.exp.isEmpty() && !data.dumperFlags.startsWith('$'))
- data.exp = "*(" + gdbQuoteTypes(data.type) + "*)" +data.hexAddress();
+ if (data.exp.isEmpty() && !data.dumperFlags.startsWith('$')) {
+ if (data.iname.startsWith("local.") && data.iname.count('.') == 1)
+ // Solve one common case of adding 'class' in
+ // *(class X*)0xdeadbeef for gdb.
+ data.exp = data.name.toLatin1();
+ else
+ data.exp = "*(" + gdbQuoteTypes(data.type) + "*)" +data.hexAddress();
+ }
}
void setWatchDataAddress(WatchData &data, const GdbMi &addressMi, const GdbMi &origAddressMi)