Commit 0e0b356b authored by hjk's avatar hjk Committed by hjk

debugger: show vtable ptr in hex, also with gdb

Task-number: QTCREATORBUG-6109
Change-Id: I9df2ddcd47e3551b23af20d2199b45fbee34bf9f
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 5d810a65
...@@ -68,13 +68,6 @@ bool isPointerType(const QByteArray &type) ...@@ -68,13 +68,6 @@ bool isPointerType(const QByteArray &type)
return type.endsWith('*') || type.endsWith("* const"); 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) bool isCharPointerType(const QByteArray &type)
{ {
return type == "char *" || type == "const char *" || type == "char const *"; return type == "char *" || type == "const char *" || type == "char const *";
...@@ -165,6 +158,14 @@ bool WatchData::isEqual(const WatchData &other) const ...@@ -165,6 +158,14 @@ bool WatchData::isEqual(const WatchData &other) const
&& error == other.error; && 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) void WatchData::setError(const QString &msg)
{ {
setAllUnneeded(); setAllUnneeded();
......
...@@ -93,6 +93,7 @@ public: ...@@ -93,6 +93,7 @@ public:
bool isLocal() const { return iname.startsWith("local."); } bool isLocal() const { return iname.startsWith("local."); }
bool isWatcher() const { return iname.startsWith("watch."); } bool isWatcher() const { return iname.startsWith("watch."); }
bool isValid() const { return !iname.isEmpty(); } bool isValid() const { return !iname.isEmpty(); }
bool isVTablePointer() const;
bool isEqual(const WatchData &other) const; bool isEqual(const WatchData &other) const;
......
...@@ -428,7 +428,7 @@ QString WatchModel::formattedValue(const WatchData &data) const ...@@ -428,7 +428,7 @@ QString WatchModel::formattedValue(const WatchData &data) const
if (data.type == "va_list") if (data.type == "va_list")
return value; return value;
if (!isPointerType(data.type) && !isVTablePointer(data.type)) { if (!isPointerType(data.type) && !data.isVTablePointer()) {
bool ok = false; bool ok = false;
qulonglong integer = value.toULongLong(&ok, 0); qulonglong integer = value.toULongLong(&ok, 0);
if (ok) if (ok)
......
...@@ -85,7 +85,6 @@ bool hasLetterOrNumber(const QString &exp); ...@@ -85,7 +85,6 @@ bool hasLetterOrNumber(const QString &exp);
bool hasSideEffects(const QString &exp); bool hasSideEffects(const QString &exp);
bool isKeyWord(const QString &exp); bool isKeyWord(const QString &exp);
bool isPointerType(const QByteArray &type); bool isPointerType(const QByteArray &type);
bool isVTablePointer(const QByteArray &type);
bool isCharPointerType(const QByteArray &type); bool isCharPointerType(const QByteArray &type);
bool startsWithDigit(const QString &str); bool startsWithDigit(const QString &str);
QByteArray stripPointerType(QByteArray type); QByteArray stripPointerType(QByteArray type);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment