aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger
diff options
context:
space:
mode:
authorhjk <[email protected]>2011-11-11 17:51:29 +0100
committerhjk <[email protected]>2011-11-11 17:54:13 +0100
commit0e0b356bd7fd7b9de243cb8a3968ced51c5e0d48 (patch)
tree39248feec1a7f3b7b029befdefdee701aba6494d /src/plugins/debugger
parent5d810a65b35c331cc7feb42d7deecac35bd08336 (diff)
debugger: show vtable ptr in hex, also with gdb
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r--src/plugins/debugger/watchdata.cpp15
-rw-r--r--src/plugins/debugger/watchdata.h1
-rw-r--r--src/plugins/debugger/watchhandler.cpp2
-rw-r--r--src/plugins/debugger/watchutils.h1
4 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp
index 9513fb4ed87..63d367b270b 100644
--- a/src/plugins/debugger/watchdata.cpp
+++ b/src/plugins/debugger/watchdata.cpp
@@ -68,13 +68,6 @@ bool isPointerType(const QByteArray &type)
return type.endsWith('*') || type.endsWith("* const");
}
-bool isVTablePointer(const QByteArray &type)
-{
- // FIXME: That is cdb only.
- // But no user type can be named like this, so this is safe.
- return type.startsWith("__fptr()");
-}
-
bool isCharPointerType(const QByteArray &type)
{
return type == "char *" || type == "const char *" || type == "char const *";
@@ -165,6 +158,14 @@ bool WatchData::isEqual(const WatchData &other) const
&& error == other.error;
}
+bool WatchData::isVTablePointer() const
+{
+ // First case: Cdb only. No user type can be named like this, this is safe.
+ // Second case: Python dumper only.
+ return type.startsWith("__fptr()")
+ || (type.isEmpty() && name == QLatin1String("[vptr]"));
+}
+
void WatchData::setError(const QString &msg)
{
setAllUnneeded();
diff --git a/src/plugins/debugger/watchdata.h b/src/plugins/debugger/watchdata.h
index eea696cbf3d..15d831048f7 100644
--- a/src/plugins/debugger/watchdata.h
+++ b/src/plugins/debugger/watchdata.h
@@ -93,6 +93,7 @@ public:
bool isLocal() const { return iname.startsWith("local."); }
bool isWatcher() const { return iname.startsWith("watch."); }
bool isValid() const { return !iname.isEmpty(); }
+ bool isVTablePointer() const;
bool isEqual(const WatchData &other) const;
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 1a60eb1b4fe..2c80c368b75 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -428,7 +428,7 @@ QString WatchModel::formattedValue(const WatchData &data) const
if (data.type == "va_list")
return value;
- if (!isPointerType(data.type) && !isVTablePointer(data.type)) {
+ if (!isPointerType(data.type) && !data.isVTablePointer()) {
bool ok = false;
qulonglong integer = value.toULongLong(&ok, 0);
if (ok)
diff --git a/src/plugins/debugger/watchutils.h b/src/plugins/debugger/watchutils.h
index 82ec733dca5..771cdad6516 100644
--- a/src/plugins/debugger/watchutils.h
+++ b/src/plugins/debugger/watchutils.h
@@ -85,7 +85,6 @@ bool hasLetterOrNumber(const QString &exp);
bool hasSideEffects(const QString &exp);
bool isKeyWord(const QString &exp);
bool isPointerType(const QByteArray &type);
-bool isVTablePointer(const QByteArray &type);
bool isCharPointerType(const QByteArray &type);
bool startsWithDigit(const QString &str);
QByteArray stripPointerType(QByteArray type);